UIPopoverController crash on iPad running iOS 5.0.1?

Up vote 0 down vote favorite share g+ share fb share tw.

I am using a UIImagePickerController on iOS 5 with the iPad and my app just got rejected because it crashed on their end. It doesn't crash on my end but I am sure it has to do with the UIPopoverController. Please just point anything out that looks bad!

To show the UIImagePickerController: - (IBAction)photoLibraryiPad { if (popoverController) { if (self. PopoverController isPopoverVisible) { self. PopoverController dismissPopoverAnimated:YES; popoverController setDelegate:nil; popoverController release; } } else { if (UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeSavedPhotosAlbum) { UIImagePickerController *imagePicker = UIImagePickerController alloc init; imagePicker.

Delegate = self; imagePicker. SourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker. AllowsEditing = YES; self.

PopoverController = UIPopoverController alloc initWithContentViewController:imagePicker; popoverController. Delegate = self; self. PopoverController presentPopoverFromRect:photolibrarybutton.

Frame inView:self. View permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES; imagePicker release; } } } Then this is where it is crashing on their end: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { if (self. PopoverController isPopoverVisible) { self.

PopoverController dismissPopoverAnimated:YES; popoverController setDelegate:nil; popoverController release; } noimageAvailable setHidden:YES; UIImage *originalImage = (UIImage *) info objectForKey: UIImagePickerControllerEditedImage; imgPic setImage:originalImage forState:UIControlStateNormal; // Hide picker selector picker dismissModalViewControllerAnimated: YES; picker release; } ios ipad uiimagepickercontroller uipopovercontroller link|improve this question edited Dec 13 '11 at 2:21 asked Dec 13 '11 at 2:11iBrad Apps1,124422 100% accept rate.

Two things: 1) When you release the popover, you should set the delegate to nil. PopoverController. Delegate = nil before calling popoverController release.

Chances are if you try to use the picker multiple times, it will crash for you too. The delegate is calling an object that no longer exists. 2) When checking to see if the popover is visible, check to make sure it exists first.

– iBrad Apps Dec 13 '11 at 2:25 I ended up fixing the crash. Turns out I had to dismiss the popover after the I dismiss the picker which makes sense. But anyway, how would I fix that leak anyway?

– iBrad Apps Dec 13 '11 at 4:06 Looks good. In the delegate method, set the delegate to nil for the picker before releasing it. – sho Dec 13 '11 at 12:46 Alright and lastly how would I properly fix the leak?

– iBrad Apps Dec 13 '11 at 17:20.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions