We are using Zbar bar code reader from last 2 years. With iOS 7 and Xcode 5, after scanning 5 bar codes the app is reaching 100 % cpu use for iOS 7 device(I can see that in
Solved doing this:
in the viewdidload
readerqr = [ZBarReaderViewController new];
readerqr.readerDelegate = self;
readerqr.showsHelpOnFail = NO;
ZBarImageScanner *scanner = readerqr.scanner;
[scanner setSymbology: 0
config: ZBAR_CFG_ENABLE
to: 0];
[scanner setSymbology: ZBAR_QRCODE
config: ZBAR_CFG_ENABLE
to: 1];
// you can use this to support the simulator
if(TARGET_IPHONE_SIMULATOR) {
cameraSim = [[ZBarCameraSimulator alloc]
initWithViewController: self];
cameraSim.readerView = readerView;
}
create ZBarReaderViewController *readerqr;
as a property of your viewcontroller.
to use it:
-(void) showqr:(id)sender
{
[self presentViewController:readerqr animated:YES completion:nil];
return;
}
This way works, no leak, no cpu 100%