I have a navigation controller and it goes through that in portrait. Then, at a certain point, I push to a view that displays a graph, which I want to only display in landscape, and not even be in portrait at all (this screws up how the view looks).
In this view, GraphViewController, I have the following method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
When the view first gets pushed, it appears in portrait mode. If I rotate the phone, the view will rotate into landscape also (not upside down portrait). But I want it to not even ever be in portrait mode, not even when it starts. I have verified that this method is getting called by adding a NSLog.