Xcode UIInterfaceOrientIon不遵守应用程序规则

Xcode UIInterfaceOrientIon不遵守应用程序规则,xcode,ipad,ios5,uiinterfaceorientation,Xcode,Ipad,Ios5,Uiinterfaceorientation,我一直有一个很大的问题。 Xcode只是简单地将我的横向模式应用程序变成了纵向视图,它不会再回来了 我已经将整个应用程序编程为在Ipad上以横向模式运行 在故事板上,每个窗口都在lanscape中。 我相信我根据下面的图片正确地进行了设置 最后,在我的viewController上,我有: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return Y

我一直有一个很大的问题。 Xcode只是简单地将我的横向模式应用程序变成了纵向视图,它不会再回来了

我已经将整个应用程序编程为在Ipad上以横向模式运行

在故事板上,每个窗口都在lanscape中。 我相信我根据下面的图片正确地进行了设置

最后,在我的viewController上,我有:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}

有人知道可能会出现什么问题,或者为什么在我调整viewController时,Xcode会将屏幕设置为“不知道从哪里来”吗?

如果只支持横向,请将
shouldAutorotateToInterfaceOrientation
更改为:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
        interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        return YES;
    }
    // Default
    return NO;
}

是 啊我复制并粘贴了所有视图控制器上的代码,现在它可以工作了。谢谢