I'm having difficulty setting up the navigation controller correctly. The display will autorotate on the initial view (the root view controller), but it will not rotate on any new views that are clicked. It retains the orientation of the view when the original view was clicked.
In my application delegate, I have a navigation controller and click it.
[window addSubview:navigationController.view]; [window makeKeyAndVisible];
In the root view controller, I enable all orientations and push other views onto the controller stack.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } ParkingListController *parklc = [[ParkingListController alloc] autorelease]; [[self navigationController] pushViewController:parklc animated:YES];
I see: "Yes, we must!" It is registered once when a new view is loaded, but it does not work when the device is actually rotated.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { NSLog(@"Yes, we should!"); return YES; }
I have no init overrides, and info.plist lists all four orientations.
What am I missing? Thanks!
EDIT 2011-07-07:
Strange map display, which is clicked when you select an item from the table view, does autorotation! Why can it rotate when the view of the table from which it is derived cannot?
source share