Hi, I am working on an iPad application and have received a request to reject all popovers (if any) when the application goes into the background.
I studied online and did not find an easy way to do this. I would like to share some of my ideas here and see if there is a better way to do this.
1, Reject popovers in didEnterBakcground in the delegate. It seems impractical since we have to add a link to popovers.
2, go to all views recursively in the current window to find popover view (class = _UIPopoverView). It seems a bit hacked and dangerous.
3, configure UIApplicationDidEnterBackgroundNotificationgroundNotification in each object that owns popovers and fire them. It seems reasonable, but really troublesome, if your application has hundreds of popovers.
4, How about adding a category method say - (void) rejectWhenAppWillEnterBackground; and register a notification.
Or is there an easier way to do this?
source share