Question

As what I said above. I encountered a problem that I have to dismiss the popover on screen while I don't know where it come from.

What I want to do is : when the app become inactive, I want to dismiss the popover. But I don't know where the popover is presented, and which controller is responds to it?

Is there a notification which I could listen to when the UIPopover is presented?

Or can I find the Popover on the screen?

Thank you guys.

Was it helpful?

Solution

Just subclass your own implementation of UIPopoverController and overridepresentPopoverFromRect:inView:permittedArrowDirections:animated and presentPopoverFromBarButtonItem:permittedArrowDirections:animated and keep track of popover references in a global array. Since Apple's HIG says only one popover is allowed at a time on screen, you only need to track the last one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top