1

I just received an error when trying to present a UIImagePickerController modally. The error essentially stated I needed to show the ImagePicker using a UIPopoverController.

My problem is I am already in a UIPopoverController, and the error is suggesting I may need to show two popover controllers, my own, and then UIImagePickerController. This is of course against the iPad HIG and grounds for app rejection.

Any elegant ways around this? Are two popovers allowed in this case? Or am I going to have bite the bullet and close my old popover (which I really don't want do ), show the image picker, then reshow my old one?

Thanks!

SSS
  • 179
  • 2
  • 10

1 Answers1

2

As another option, you could use the popover's setContentViewController: or setContentViewController:animated: to change to the UIImagePickerController and then change back to your own view controller.

Anomie
  • 92,546
  • 13
  • 126
  • 145
  • Hmm, interesting. I will give that a try and see how it looks. Thanks for the input! – SSS Apr 28 '11 at 15:10
  • Works for me. Make sure you call [self.popover setContentViewController: ]; in the controller that presented the popover. – pdesantis Aug 09 '12 at 21:40
  • This WAS the correct answer a long time ago but UIPopoverController is now deprecated in general. Without using UIPopoverController this solution does not work. – w0mbat Mar 18 '22 at 16:45