I developed IOS 5 application using game center. Now I want my code to run on IOS 6. So I have let my application to support both orientation i.e landscape and portrait so that it does not crashes when game center login screen pops up. But after that, my home view controller does not starts in landscape view. Instead when I go to a further view, it opens in landscape, and then when i come back, then the home view opens in landscape. But home view does not opens to landscape mode for the first time.
Here is the code :
- (BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
These are the delegates I use in home view for IOS 6.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…