旋转不是';t在iOS5脚本中工作
我正在开发一个故事板应用程序,旋转可以在iOS6设备上运行,但当我在iOS5设备上运行它时,它不会旋转。我在导航控制器中嵌入了一个视图控制器(因此导航控制器是窗口的根视图控制器),并且覆盖了以下方法:旋转不是';t在iOS5脚本中工作,ios,xcode,cocoa-touch,Ios,Xcode,Cocoa Touch,我正在开发一个故事板应用程序,旋转可以在iOS6设备上运行,但当我在iOS5设备上运行它时,它不会旋转。我在导航控制器中嵌入了一个视图控制器(因此导航控制器是窗口的根视图控制器),并且覆盖了以下方法: - (BOOL)shouldAutorotate { return YES; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientat
- (BOOL)shouldAutorotate
{
return YES;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight|UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskPortrait;
}
-(BOOL)shouldAutoRotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation ==UIInterfaceOrientationPortrait)){
return YES;
} else {
return NO;
}
}
我也有plist中允许的3个方向,我的部署目标是iOS5,基本SDK iOS6和autolayout都关闭了,我想知道为什么这不起作用
谢谢大家! 你的评论让我仔细看了看。这是因为你的自转中有一个大写字母“R” 将方法名称更改为:
shouldAutorotateToInterfaceOrientation:
你的评论让我仔细看了看。这是因为你的自转中有一个大写字母“R”
将方法名称更改为:
shouldAutorotateToInterfaceOrientation:
对不起,我忘了提到在iOS6上运行时,我在导航控制器的所有方法中都设置了断点,而应用程序确实破坏了这些方法。我忘了提到在iOS6上运行时,我在导航控制器的所有方法中都设置了断点应用程序确实突破了这些方法