4

http://github.com/TheLevelUp/ZXingObjCを使用して、Mac アプリで QR コードを作成しようとしています。

すべてのバーコード タイプで機能しますが、QRcode では nil を返します! 「結果」と「エラー」の両方が空です。ここに私のコードがあります:

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);
}

何が問題なのですか?

4

2 に答える 2