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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to