Question

I push a UITableViewController into a NavigationController (the NavController returned in the 0th element of a call to UISplitViewController viewControllers). I set this TVC to be the UISplitViewControllers delegate. The newly pushed TVCs delegate functions are getting called as they should but they are called with the popoverController from the previous TVC. (That is the next guy down in the stack) Therefore the size of the popoverController is wrong. I can hack my way around this with popoverController.popoverContentSize, but I would like to fix the underlying problem. I see the underlying problem being: that the SplitViewController is calling its delegate with the wrong popoverController in the delegate function willHideViewController. Any suggestions?

Was it helpful?

Solution

I would definitely not make the UITableViewController that gets pushed on a stack the delegate for the UISplitViewController -- I don't see the advantage to making it the delegate, especially since it would appear in the master side, and it also disappears as soon as the back button gets hit. I make the detail view the delegate, since it's always present, and it's the view controller that will have to handle hiding/showing popovers, anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top