Saty
Saty

Reputation: 2621

ZBarSymbol not correctly reading the code

I am using ZbarSdk in my app to scan the qrcode, in my

- (void) readerView: (ZBarReaderView*) viewdidReadSymbols: (ZBarSymbolSet*) syms
      fromImage: (UIImage*) img method, I am writing following code,

 for(ZBarSymbol *sym in syms) {
 NSLog(@"%i",[sym.data length]);
 NSLog(sym.data);
 resultText= [NSString stringWithString:sym.data];
 NSLog(resultText);
 break;       
}

Where resultText is a NSString however when ever I try to scan following QRCode, it shows odd characters and numbers inside the string, which is causing a problem for me.

QR Code I am scanning

Nslog for sym.data shows "http://www.winlogisticsmedia.com/images/bigkmr 8.195737e-164ndhttp://www.winlogisticsmedia.com/images/bigkmr%20end%20sale.jpgale.jpg"

However it should show "http://www.winlogisticsmedia.com/images/bigkmr%20end%20sale.jpg"

Upvotes: 0

Views: 268

Answers (1)

Rafe
Rafe

Reputation: 809

Try NSLog(@"%@", sym.data); - works for me on iOS SDK 6.1.

Using NSLog(sym.data); gives a "Format string not a string literal (potentially insecure)" warning in Xcode and an EXC_BAD_ACCESS error when debugging.

Upvotes: 0

Related Questions