I am trying to use http://github.com/TheLevelUp/ZXingObjC to create QR codes in my Mac application.
It works for every type of barcode, but returns zero on a QR code! "result" and "error" are empty. here is my code:
NSError* error = nil; ZXMultiFormatWriter* writer = [[ZXMultiFormatWriter alloc] init]; ZXBitMatrix* result = [writer encode:@"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" format:kBarcodeFormatQRCode width:1750 height:1750 hints:[[ZXEncodeHints alloc] init] error:&error]; if (result) { CGImageRef image = [[ZXImage imageWithMatrix:result] cgimage]; self.image.image = [[NSImage alloc] initWithCGImage:image size:NSMakeSize(1750, 1750)]; } else { NSLog(@"error: %@", error); }
What's wrong?
source share