views:

30

answers:

1

My app uses 2 UIWindows. The first shown has a TabBar controller with ViewControllers that only rotate to Portrait orientations. Up to here everything woks fine.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 return (UIInterfaceOrientationIsPortrait(interfaceOrientation));
}

On the other window I have a UIViewController that rotates to all orientations.

The problem is that when I show the second window

[secondWindow makeKeyAndVisible];

And then return to the first one

[firstWindow makeKeyAndVisible];

The statusbar rotates to all directions and the event shouldAutorotateToInterfaceOrientation is not fired. How can i solve the problem?

A: 

An iOS app should only have one UIWindow. You can modally stack multiple UIViewControllers on top off that one window, and the rotate messages should then propagate down the view controller stack.

hotpaw2