Question regarding popoverControllerDidDismissPopover: delegate method
Question regarding popoverControllerDidDismissPopover: delegate method
- Subject: Question regarding popoverControllerDidDismissPopover: delegate method
- From: Jon Brooks <email@hidden>
- Date: Wed, 5 Jan 2011 17:20:19 -0800
My iPad application has a UIPopover that presents a table view. When a user clicks on an item in the table view, the contentController dismisses the popover. Also, the popover has the default behavior such that a click outside the popover will dismiss it as well. The parent viewController retains the popoverController when it is shown and releases it when it is dismissed. Because of this, I need to detect when a touch outside the popover has dismissed it, and release the popover controller. I do this using the delegate method popoverControllerDidDismissPopover:. All of this seems like it would be a pretty standard implementation of a UIPopover.
The problem comes if a user simultaneously taps both an item in the popover, and outside the popover. In this case, I first get the delegate, popoverControllerDidDismissPopover: which is fielding the tap outside the popover, followed by my method responding to the touch inside the popover, which tries to dismiss an already dismissed popover.
On the surface, all of this seems to be harmless, but triggers asserts I have in place to detect this. I am nervous about removing the asserts, because after popoverControllerDidDismissPopover: has been called, nothing in my code is retaining the popover controller, yet my method that responds to touches inside it is will rely on it still being around. Should I just assume that if it's still fielding touches, that it's still retained by a view, and everything will be fine?
Is this a bug that the popover is still fielding a touch after the delegate method popoverControllerDidDismissPopover: is called?
Thanks in advance for any advice.
Jon Brooks
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden