ios 6 iPhone window.rootViewController崩溃
我的应用程序在iPad和iPhone上都可以正常使用iOS 5.1。在iOS 6应用程序可以在iPad上正常工作,但在iPhone上设置window.rootViewController = navigationViewController
时崩溃。我在application didFinishLaunchingWithOptions
中的这段代码处设置了异常断点,该断点停止执行。我甚至尝试添加它作为[window addSubView:navigationViewController.view]
,但没有运气。有没有人遇到过类似的问题。ios 6 iPhone window.rootViewController崩溃
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
rootViewController = [[SpringboardViewController alloc] initWithNibName:@"SpringboardViewController" bundle:nil];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootViewController];
self.window.rootViewController = nav;
self.window makeKeyAndVisible];
return YES;
}
你能写出一个异常吗?
看看这些问题
applications expected to have a root view controller console
Applications are expected to have a root view controller at the end of application launch
食人魔感谢您的回复,但我的应用程序正常工作与5.1问题只与iPhone 6.0也没有错误,显示出来提供更多的信息关于我的问题。 – kaar3k 2013-02-19 06:52:39
感谢您的答复家伙我想通了这个问题,问题出在application supportedInterfaceOrientationsForWindow
我在那里,因为应用程序返回UIInterfaceOrientationPortrait
代替UIInterfaceOrientationMaskPortrait
调试器被击中self.window.rootViewController = nav,我认为问题是与此声明。
谢谢Ravindharan和Ogres。
你可以发布didFinishLaunchingWithOptions方法代码 – Ravindhiran 2013-02-19 06:20:01
这与iPhone和iPad的IOS 5.1完全正常也与ios 6.0 iPad的问题只与iPhone 6.0。我粘贴上面的代码.Debugger停在'self.window.rootViewController = nav;'没有任何错误日志。它只是在控制台中打印** lldb **。 – kaar3k 2013-02-19 06:50:24