1
votes

I'm in a bit of a pickle here. I have an app written for ios7.1 and we are now trying to make the same app support ios 8.1.

In this app we have several popovers. I've gone through the fix of having them show up properly as a popover in iOS8 but when I click on the popover it doesn't respond as expected.

Here's how it is being presented (all hooked up in storyboard):

in DashboardViewController:

if ([segue.identifier isEqualToString:@"showRHSMenu"]) {
_rightNavController =  segue.destinationViewController;
_rightNavController.preferredContentSize = CGSizeMake(220, (_rightNavController.tableView.rowHeight * _rightNavController.dataArray.count));
_rightNavController.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController *popoverPresentationController = _rightNavController.popoverPresentationController;
popoverPresentationController.delegate = self;

}

in _rightNavController, a protocol is declared to communicate with DashboardViewController. this works and gets executed in ios7.1 using UIPopoverController but in iOS8.1 using UIPopoverPresentationController, it does not trigger.

I have confirmed that the user clicks register in the rightNavController but the protocol/delegate is not being executed.

Can anyone help please?

1

1 Answers

0
votes

An old question, but hopefully this helps someone else.

I ran into the same problem today, and the solution was to declare the popover controller as an instance variable rather than a local variable. As a local variable, it gets garbage collected any time after the method returns, regardless of whether the popover view is still on screen. (Garbage collection seems to be a lot more aggressive/efficient in iOS8, so likely just exposed a bug that you already had.) Keep a handle to the view controller until the view is dismissed, and all the delegate methods should work fine.