I have a Main view controller where I have "Scan" button. I launch scanning screen of ZBarReaderViewController on top this Main view controller. Once scan is success, I am launching to a Cocos3d based scene views, at this time, Main view controller and ZBarReaderViewController will be removed. I have a back option in Cocos3d scene. Clicking on this back option, i'll be back again to Main view controller freshly. Again, When I press Scan for scanning the bar code, its crashes. I have set NSZombieEnabled and Added exception breakpoint, but no use, its not catching anything during crash.
Here is my code flow:
.h:
@interface HOMyHomeMainMenuContoller : UIViewController <ZBarReaderDelegate>
{
ZBarReaderViewController *codeReader;
}
.m:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
codeReader = [ZBarReaderViewController new];
codeReader.cameraDevice=UIImagePickerControllerCameraDeviceFront;
codeReader.readerDelegate=self;
codeReader.supportedOrientationsMask = ZBarOrientationMaskAll;
codeReader.showsCameraControls = NO; // for UIImagePickerController
codeReader.showsZBarControls = NO;
ZBarImageScanner *scanner = codeReader.scanner;
[scanner setSymbology: ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0];
UIImage *overlayGraphic = [UIImage imageNamed:@"logo.jpg"];
UIImageView *overlayGraphicView = [[UIImageView alloc] initWithImage:overlayGraphic];
overlayGraphicView.transform= CGAffineTransformMakeRotation(M_PI/2);
overlayGraphicView.frame = CGRectMake(0, 0, 768, 1024);
[codeReader.view addSubview:overlayGraphicView];
[overlayGraphicView release];
UIImage *searchingImage = [UIImage animatedImageNamed:@"progress" duration:1.0f];;
searchingImageView = [[UIImageView alloc] initWithImage:searchingImage];
searchingImageView.frame = CGRectMake(350, 0, 70, 70);
[codeReader.view addSubview:searchingImageView];
[searchingImageView release];
codeReader.cameraOverlayView = searchingImageView;
}
-(IBAction)myButton :(id)sender
{
[self startScanning];
}
- (void) startScanning
{
[self presentViewController:codeReader animated:YES completion:NULL];
}
Can anyone please help me, why does it crash when launch back again? Could it be due to memory issue on ZBar code? Without ZBar scanning, there is no crash. But, i want the scanning functionality.
Thank you in Advance!
Crash printed in iPhone Configuration Utility:
Apr 19 00:18:09 mycompcliLABiPAD2 MyApp[1369] <Warning>: Scanning..
Apr 19 00:18:09 mycompcliLABiPAD2 MyApp[1369] <Warning>: codeReader: <ZBarReaderViewController: 0x1e534390>
Apr 19 00:18:10 mycompcliLABiPAD2 kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1
Apr 19 00:18:10 mycompcliLABiPAD2 kernel[0] <Debug>: AppleH4CamIn::power_on_hardware
Apr 19 00:18:10 mycompcliLABiPAD2 kernel[0] <Debug>: AppleH4CamIn::ISP_SelectBestMIPIFrequencyIndex_gated - channel: 1, index: 0
Apr 19 00:18:10 mycompcliLABiPAD2 MyApp[1369] <Warning>: Received memory warning.
Apr 19 00:18:10 mycompcliLABiPAD2 com.apple.launchd[1] (UIKitApplication:com.apple.mobilemail[0xb71e][1321]) <Notice>: (UIKitApplication:com.apple.mobilemail[0xb71e]) Exited: Killed: 9
Apr 19 00:18:10 mycompcliLABiPAD2 com.apple.launchd[1] (com.apple.tccd[1331]) <Notice>: (com.apple.tccd) Exited: Killed: 9
Apr 19 00:18:10 mycompcliLABiPAD2 com.apple.launchd[1] (com.apple.coreservices.appleid.authentication[1378]) <Notice>: (com.apple.coreservices.appleid.authentication) Idle-exit job was jettisoned while dirty. Will respawn immediately.
Apr 19 00:18:10 mycompcliLABiPAD2 com.apple.launchd[1] (com.apple.coreservices.appleid.authentication[1378]) <Notice>: (com.apple.coreservices.appleid.authentication) Exited: Killed: 9
Apr 19 00:18:11 mycompcliLABiPAD2 com.apple.launchd[1] (UIKitApplication:com.mycomp.hOInsTestFronview[0xca93][1369]) <Notice>: (UIKitApplication:com.mycomp.hOInsTestFronview[0xca93]) Exited: Killed: 9
Apr 19 00:18:11 mycompcliLABiPAD2 UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Apr 19 00:18:11 mycompcliLABiPAD2 backboardd[27] <Warning>: Application 'UIKitApplication:com.apple.mobilemail[0xb71e]' exited abnormally with signal 9: Killed: 9
Apr 19 00:18:11 mycompcliLABiPAD2 backboardd[27] <Warning>: Application 'UIKitApplication:com.mycomp.hOInsTestFronview[0xca93]' exited abnormally with signal 9: Killed: 9
Apr 19 00:18:11 mycompcliLABiPAD2 kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 0
Apr 19 00:18:11 mycompcliLABiPAD2 kernel[0] <Debug>: AppleH4CamIn::power_off_hardware
Apr 19 00:18:11 mycompcliLABiPAD2 kernel[0] <Debug>: launchd[1384] Builtin profile: MobileMail (sandbox)
Apr 19 00:18:12 mycompcliLABiPAD2 ReportCrash[1383] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:12 mycompcliLABiPAD2 ReportCrash[1383] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2014-04-19-001812.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Apr 19 00:18:13 mycompcliLABiPAD2 kernel[0] <Debug>: launchd[1385] Builtin profile: CommCenter (sandbox)
Apr 19 00:18:13 mycompcliLABiPAD2 CommCenterClassic[1385] <Error>: objc[1385]: Class CTPhoneNumber is implemented in both /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony and /System/Library/Frameworks/CoreTelephony.framework/Support/CommCenterClassic. One of the two will be used. Which one is undefined.
Apr 19 00:18:13 mycompcliLABiPAD2 CommCenterClassic[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:13 mycompcliLABiPAD2 CommCenterClassic[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:13 mycompcliLABiPAD2 CommCenterClassic[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:13 mycompcliLABiPAD2 CommCenterClassic[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:14 mycompcliLABiPAD2 CommCenter[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:14 mycompcliLABiPAD2 CommCenter[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:14 mycompcliLABiPAD2 CommCenter[1385] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:14 mycompcliLABiPAD2 CommCenter[1385] <Notice>: Communications Center Started.
Apr 19 00:18:14 mycompcliLABiPAD2 awdd[1387] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Apr 19 00:18:14 mycompcliLABiPAD2 awdd[1387] <Error>: CoreLocation: CLClient is deprecated. Will be obsolete soon.
Apr 19 00:18:17 mycompcliLABiPAD2 kernel[0] <Debug>: launchd[1390] Builtin profile: syncdefaultsd (sandbox)