I am using my application delegate to swap out views. First I remove the current view, then I add the new view, then I run a quartz animation.
No matter what view I load first, the orientation changes occur as expected. As soon as I start adding new views (removing the old) to the window in the application delegate, orientation changes no longer happen. Assume shouldAutorotateToInterfaceOrientation is present with YES in all my UIViewControllers.
I took out the quartz animation and here is where I am still stuck:
-(void) showSongList {
[songVC.view removeFromSuperView];
navVC = [[NavigationViewController alloc] initWithNibName:0 bundle:0];
[window addSubView:navVC.view];
[songVC release];
songVC = nil;
}
Switch views works fine. The first view always responds and switches orientation, then any changes I make to the window adding views (always removing the previous), diminishes the orientation changes.
If I load navVC right away it will rotate orientation, but when it's further down the line from a button event, I get the orientation problem I've described.
NSLog(@"subview count = %d", [[window subviews] count]); //always 1
I have tried using NSLog in didRotateFromInterfaceOrientation and this function obviously is only called when an orientation change occurs.
My app delegate window always only has one subview, so I'm lost!