I have an iPad application with a main view controller, which have a status bar and navigation bar on the top.
When I rotate this main view - everything is fine. But when I present a modal (full screen) view controller and rotate the device when its presented, this happens:
The presented view controller is rotated as expected.
When dismissed, the main view is still in the orientation which it was when presenting (wrong one), but the status bar is on top (like only the status bar was rotated).
After playing with the device a bit, the orientation changes to what it should, but now the status bar does not have it's 20px margin on top - it is now overlapping the navigation bar, which looks awful.
Any ideas on what caused this strange situation?
EDIT: not using UINavigationController prevents the statusBar overlapping the navigation bar issue, but the rotation issue still exists.
View orientations usually don't get automatically updated if they are not visible. You can manually set the orientation on viewWillAppear.
This link should set you off on the right foot.