subviews show confused rotated state after a modal dialog is displayed

Posted by deafgreatdane on Stack Overflow See other posts from Stack Overflow or by deafgreatdane
Published on 2010-05-16T16:12:08Z Indexed on 2010/05/16 16:20 UTC
Read the original article Hit count: 183

Filed under:

I've created a custom UIViewController that mimics the UISplitViewController. It manages two child view controllers that get displayed in the left & right body area while in landscape and hides the left to show in a popover when in portrait. It works fine, using the didRotateFromInterfaceOrientation: and willRotateToInterfaceOrientation: messages to reset the location and sizing of the child views. All the views and child controllers are loaded from a nib. This custom view controller is shown inside a UINavigationController.

The trouble arises after one of the child view controllers uses presentModalViewController. If the device was rotated after the views were initialized (but before the modal controller is shown), after the modal dialog is dismissed, the left and/or body views will be re-rendered in a different rotation than they were before the modal dialog was changed.

I'm wondering if folks have had a similar problem, and what the solution is. I'm sure sample code would be helpful, but it'll take a bunch of work to distill it into a runnable sample.

© Stack Overflow or respective owner

Related posts about cocoa-touch