When running my app in iOS 7 I get the following error when trying to display a popover: [UIPopoverController dealloc] reached while popover is still visible
It works fine in iOS 8.
My code to show the popup is:
let vc = InfoViewController()
vc.setText(txt)
vc.modalPresentationStyle = .Popover
var w=vc.width
if w<200 {
w=200
}
vc.preferredContentSize = CGSizeMake(w+30,height+30)
let popRect = rect
let aPopover = UIPopoverController(contentViewController: vc)
aPopover.presentPopoverFromRect(popRect, inView: view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)
An easy way to fix this is declare your popover as a member variable of your class and using it.
var aPopover : UIPopoverController?
And in that method change the code like:
self.aPopover = UIPopoverController(contentViewController: vc)
self.aPopover!.presentPopoverFromRect(popRect, inView: view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)