Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jnoxx

macrumors 65816
Original poster
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
Hai Guys!

Having some issues..
I have an app with a root controller, this is landscape only. I checked this all in the nibs, and edited the .plist, so it's landscape(left/right) only. and my method returns

Code:
 // Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	// Return YES for supported orientations.
	return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}

So when I push my special controller onto the stack (it's a navigationcontroller). it also goes landscape, and that's possible going to portrait mode. but if i switch the second controller to portrait mode, and then go back to my root, this is also portrait mode. So it doesn't do a second check, and changes again.. Any idea how I would go on checking how to fix this?


Gz, Noxx
 
Try this for your landscape view.

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
 
Tried all that, it's a headbreaker, since it's for only demo'ing, and not appstore material, i'm using this private method now..

Code:
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];

It's undocumented, but it works great ;/
I'll have to figure it out later.
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.