Nico AD
Nico AD

Reputation: 1709

exc_bad_access with UIImagePickerController and UIPopoverController

I get a EXC_BAD_ACCESS right after calling this piece of code in my app (Ipad)

I get almost nothing from XCode for debugging, XCode points me that line of code:

int retVal = UIApplicationMain(argc, argv, nil, nil);

I guess an object has been autoreleased too early but why and how to fix this?

NSLog(@"OpenPhotoDialog");
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = srcType;

UIDevice* thisDevice = [UIDevice currentDevice];

UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker] ;
popover.delegate = self;

[popover presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

Upvotes: 1

Views: 868

Answers (1)

Srinivas
Srinivas

Reputation: 983

Usually EXC_BAD_ACCESS Will Come Sending Object To the Deallocated Blocks.

if you set The Argument in Executables

NSZombieEnabled YES

Then you Can Know Which Object is De allocating Which is So longer Used.

cheers

Upvotes: 2

Related Questions