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

LastLine

macrumors 65816
Original poster
Aug 24, 2005
1,313
21
Hey guys,

I've been using this
Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    return UIInterfaceOrientationIsLandscape(interfaceOrientation);

     [self prepareTapView];

     

     

    //     return NO;

}

For the longest time to force a landscape orientation.

Under the new iOS SDK it doesn't work and just sits in portrait - frustrating at best, crippling at worst. Can anyone suggest how I change this to fit the new guidelines? I've ben having real trouble with it.

I've looked at the update notes but can't figure out what to do. Anyone able to help?
 
I'm still looking closer at this one. Oddly, the simulator doesn't rotate with the 'old' code, but an iPad does.

The trick seems to be the method used to set the root view controller for the apps window. A newer method needs to be used. Something like the following.

Code:
[appDelegate.window setRootViewController: myVC];


You _might_ have to do the following in some view controllers. I'm not sure it is required because, well long story and I'm still investing.

Code:
- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll; // use what is appropriate for you.
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.