0

I am working on an app that lets the user select images from his own photo album. It works on iPhone, but not on iPad.

I made a UIPopoverController, and it all works fine, the user can pick a photo, but when the user pushes "USE" button. the app cashes a says

UIPopoverController dealloc] reached while popover is still visible

here is the code:

- (void)choosePhotoFromLibraryipad:(id)sender{


    if(![popoverController isPopoverVisible]){


    imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    imagePicker.delegate = self;
    imagePicker.allowsEditing = YES;

    self.popoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];

    [self.popoverController presentPopoverFromRect:CGRectMake(0.0, 0.0, 400.0, 400.0)
    inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES ];

    }
}
Undo
  • 25,519
  • 37
  • 106
  • 129
  • 2
    have you written `[popoverController dismissPopoverAnimated:YES];` when you want to hide popover? And please specify that you are using `ARC` or not? – Shah Paneri Mar 13 '13 at 04:16
  • 1
    YES i have forgotten to make a [popoverController dismissPopoverAnimated:YES]; embarrassing :-D after so many hours, its was that easy – Jens Andersen Mar 13 '13 at 21:38

1 Answers1

5

Check your .h file. Make sure that your @property for your popoverController is strong instead of weak. Many an hour of time has been wasted over simple things like this.

Undo
  • 25,519
  • 37
  • 106
  • 129