I have a UIPopoverController presented from a UIBarButtonItem. I have another UIBarButtonItem that is a home button that when pressed,
[self.navigationController popToRootViewControllerAnimated:YES];
The problem is, my popover is still visible and then I get a SIGABRT when I popToRootViewController since in my dealloc method, I release memory on the popover. The popover stays visible as well. The error is
Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.'
What I don't understand is, I thought the default action was for a popover to be dismissed when you click somewhere else on the screen. How do I handle this use case? Thanks.