wi have 2 questions about using a popover in my application. First is about the popoverControllerDidDismissPopover function, it is never called in my application. I checked here about the same topics and found out that normally the problem is that the delegate is not set. But in my case i had:
class MainTableViewController: ...,UIPopoverControllerDelegate {
And to call the modal:
var popover: UIPopoverController!
On my cell tap event
popover = UIPopoverController(contentViewController: popoverContent)
popover.delegate = self
popover.presentPopoverFromRect(currentCell.LabelCellTitle.frame, inView: currentCell.LabelCellTitle.superview, permittedArrowDirections: UIPopoverArrowDirection.Left, animated: true)
The popover appears, but if i tap outside of it the method:
popoverControllerDidDismissPopover
will not be called. Any ideas?
The second question is about an error ill get when i tap on my cell again to load up the popover.
Warning: Attempt to present <...24ModalTableViewController: 0x7fda8a55e440> on <...23MainTableViewController: 0x7fda8a62eb80> which is already presenting (null)
Ok, i guess that mean that the ModalTableViewController is still there. Do i need it to set to nil with the popoverControllerDidDismissPopover function? Or how do i solve this warning?
Thanks in advance.
Edit:
After cleaning my projekt problem 1 is now solved (little mysterious) - maybe a bug in XCode Beta. Problem 2 still present
Edit2:
If i now set the Content and the Popover to nil after dismiss, i got the following error:
func popoverControllerDidDismissPopover(popoverController: UIPopoverController!) {
self.popover = nil
self.popoverContent = nil
}
Application tried to represent an active popover presentation
Why is the popover still active?