views:

182

answers:

0

Our iPad app has a view / view controller hierarchy laid out a little like this:

rootViewController
|
|
|
a UISplitViewController |
|                       |
|                       |
|                       |  
tableViewController1     tableViewController2 (implements UISplitViewControllerDelegate)

The rootViewController adds and remove views manually, so this split hierarchy will be shown and hidden several times. Consequently we use the rootViewController to pass along viewWillAppear, etc. methods to the view controllers it manages, if appropriate.

In this case, tableViewController1 is shown in the left-hand pane in landscape and in a popover from a UIBarButtonItem in portrait. Also, tableViewController2 will sometimes cause the rootViewController to present a full-screen modal view controller.

The issue we've run into is that upon rotation, the UISPlitViewControllerDelegate method splitViewController:willHideViewController:withBarButtonItem:forPopoverController doesn't get called on tableViewController2. I've noticed that this method gets called in didRotateFromInterfaceOrientation: and that when the modalViewController was visible, didRotateFromInterfaceOrientation would no longer be called on rootViewController. Even when I forced the modal view controller to pass along the didRotate method, the UISplitviewControllerDelegate methods were never called.

I'd really appreciate any input here, I'm not too sure what I'm doing wrong!