I have several uiPopoverControllers in my universal iPad app. I now have a requirement to trigger a function once a certain popover has been dismissed. I can do this easily if the user clicks “close” inside the popover, but if they touch the screen to hide the popover, I cannot trigger my function.
I’ve been googling for some time and cannot seem to find any delegate methods which I might be able to use in my main view controller to capture them. I would love something like didDismissPopoverController – but my guess is it’s not available.
IF not, I guess the only thing to do would be to detect the touches and trigger then? Basically I am highlighting a UITableView row and loading the popover. I need to deselect the row – so want to simply call [table reloaddata].
Thanks for any help on this one!
You need to assign a delegate to the
UIPopoverControllerand then implement the- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverControllermethod. For example:When you instantiate the
UIPopoverController(say, for this example, inFooController)…Then, you would implement the method:
Granted, I haven’t tested this but it seems like it should work…
Hope this helps!