views:

52

answers:

1

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?

A: 

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.

Shaggy Frog
Interesting point. Let me think about that... By way of explanation, each row in the TVC's has its own navigationController full of DetailViewControllers. The DVC's are able to push more DVC's into their NC's by means of buttons on pages. So, I am swapping out NavControllers into the SplitViewController for both the masters and the detail view controllers. I have to keep this basic architecture but I can likely play with who is the SVCs delegate. Thanks.
StoneBreaker