主情节提要设置影响iOS8中的旋转功能

主情节提要设置影响iOS8中的旋转功能,ios8,autorotate,Ios8,Autorotate,在我的应用程序中,旋转在iOS7中工作正常,但在iOS8中不工作 如您所见,状态栏会旋转,但视图控制器不会旋转 我发现问题是由主情节提要设置引起的,但我不知道为什么会出现问题。我刚刚删除了项目文件中的主情节提要设置,在iOS8中一切都正常 下面是我加载故事板的代码 [self setMainStoryboard:[UIStoryboard storyboardWithName:@"MainStoryboard-ipad" bundle:nil]]; UIViewController *vc =

在我的应用程序中,旋转在iOS7中工作正常,但在iOS8中不工作

如您所见,状态栏会旋转,但视图控制器不会旋转

我发现问题是由主情节提要设置引起的,但我不知道为什么会出现问题。我刚刚删除了项目文件中的主情节提要设置,在iOS8中一切都正常

下面是我加载故事板的代码

[self setMainStoryboard:[UIStoryboard storyboardWithName:@"MainStoryboard-ipad" bundle:nil]];
UIViewController *vc = [mainStoryboard instantiateInitialViewController];

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
[self.window setRootViewController:vc];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];

也许我用了错误的方式加载故事板?

我解决了这个问题,但我认为这可能不是一个好的解决方案。这只是一个解决办法。不管怎样,这就是我所做的。如果遇到相同的问题,可以尝试删除目标中的主情节提要设置

就这样,没有进一步的步骤。在我移除主情节提要设置后,一切都很好。可能我加载主情节提要的方式不正确,或者我的情节提要设置有问题

以下是我用来加载情节提要的代码:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *vc = [storyboard instantiateInitialViewController];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];

// Override point for customization after application launch.
[self.window setRootViewController:nav];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
如果有人知道使用主情节提要的正确方法,请给我一些反馈。谢谢