崩溃对iOS6的presentViewController:但不是在iOS5的

问题描述:

当我运行我的iOS6的模拟器应用程序和Xcode 4.5 GM种子这段代码崩溃:崩溃对iOS6的presentViewController:但不是在iOS5的

if ([[[UIDevice currentDevice] systemVersion] isEqualToString:@"6.0"]) { 
    XLog(@"hier checken"); 

    self.tabBarController = [[UITabBarController alloc] init]; 

    self.window.rootViewController = self.tabBarController; 
    [self.window makeKeyAndVisible]; 

} 

[...] 

self.loginController = [[[LoginController alloc] initWithNibName:@"LoginController_iPhone" bundle:nil] autorelease]; 

self.loginController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 

//this line occurs a crash on iOS 6 (simulator, device not tested) 
[self.tabBarController presentViewController:self.loginController 
             animated:YES 
             completion:nil]; 

的崩溃是一个SIGABRT。没有关于崩溃的更多信息。

在iOS6上发生这种崩溃的是什么?

+0

你可以发布崩溃日志吗? (即使它只是SIGABRT)? –

+0

我没有收到控制台中的任何崩溃日志。 – brush51

+0

我唯一可以建议的是评论一切,然后取消注释一行,运行并继续循环,直到它崩溃(或者您可以通过断点逐步完成)。你会知道为什么它崩溃 –

initWithNibName:bundle:是UIViewController的指定初始值设定项,在iOS6中有一些新的东西。

你可以尝试修改您的LoginController_iPhone.xib并删除其控制器:

enter image description here---->enter image description here

这对我的作品。 希望这有助于。

+0

我也试过用我所有的视图控制器,之后,我有新的错误,所以这个问题是固定的。那是正确的答案,谢谢! – brush51

我正在研究的一个应用程序,当我试图访问地址簿时会崩溃而没有任何痕迹。 ABAddressBookRef或ABAddressBook创建并允许您的应用程序访问关闭的联系人,将导致应用程序崩溃。希望这可以帮助!

+0

我不在我的应用程序中使用地址簿。这个问题有什么不同。 – brush51

+0

查找您在LoginViewController中使用的任何已弃用的apis。我遇到的大部分iOS6相关的碰撞事件都与此无关。我希望每个发布的新操作系统都有一个已弃用的API列表。顺便说一句,尝试在编译器设置中将“处理警告作为错误”选项。这应该告诉你哪些不赞成使用的APIs –

+0

我在xcode中没有警告。已经使用了所有不推荐使用的警告。我不明白:'shouldAutorotateToInterfaceOrientation'已被弃用,但我没有得到这种方法的警告。任何想法? – brush51