Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPopoverController delegate not getting called on dismiss

I assign popover object o it's contentViewController and I put dismiss code in a button which resides in the content view controller.

When the button is pressed:

 [self.popover dismissPopoverAnimated:YES];

is called and popover is dismissed. However, delegate's method is not called automatically. I thought that I was not setting it's delegate, but it is there. If I add the following line after dismissPopoverAnimated line, delegate is called correctly...

 [self.popover.delegate popoverControllerDidDismissPopover:self.popover];

I don't understand why it doesn't "automatically" call the delegate's method. How can this happen?

like image 207
frankish Avatar asked Jan 12 '14 14:01

frankish


Video Answer


1 Answers

popoverControllerDidDismissPopover is not called on Dismiss, but its called when you click outside the popoverController contentview.

https://developer.apple.com/library/ios/documentation/uikit/reference/UIPopoverControllerDelegate_protocol/Reference/Reference.html#jumpTo_4

like image 73
Edwin O. Avatar answered Oct 24 '22 19:10

Edwin O.