I am trying to initialize a ZXingWidgetController
that can work for both 2D (QRCode, DataMatrix) and 1D Barcodes (UPC, EAN) My question is if this is possible or not.
This is the code I use
ZXingWidgetController *widController = [[ZXingWidgetController alloc] initWithDelegate:self showCancel:YES OneDMode:NO];
QRCodeReader* qrcodeReader = [[QRCodeReader alloc] init];
DataMatrixReader* dmReader = [[DataMatrixReader alloc] init];
MultiFormatUPCEANReader* upceanReader = [[MultiFormatUPCEANReader alloc] init];
MultiFormatOneDReader* oneDReader = [[MultiFormatOneDReader alloc] init];
NSSet *readers = [[NSSet alloc ] initWithObjects:qrcodeReader,dmReader,upceanReader,oneDReader, nil];
[qrcodeReader release];
[dmReader release];
[upceanReader release];
[oneDReader release];
widController.readers = readers;
[readers release];
If I put OneDMode:YES
in initialization, then the app crashes with the following error
-[Not A Type _cfTypeID]: message sent to deallocated instance 0xded0270
But if I put OneDMode:NO
in initialization, the app doesn't crash but it also doesn't work for barcodes, and works only with QRCodes & 2D datamatrix codes.
Can you tell me if this is possible or not and if it is, how to do it?
Any help is appreciated in advance.