如果我的问题听起来对你们有些愚蠢,请原谅.我对iOS开发相对较新,但我必须为iOS6移植应用程序.该应用程序在iOS 5和XCode 4.3.2上运行良好,但我在iPhone 6.0模拟器上有一个奇怪的Xcode 4.5错误.加载初始屏幕后,我可以点击我想要的任何按钮,我收到错误:
`Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'register'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.`
Run Code Online (Sandbox Code Playgroud)
StartScreenViewController的prepareForSegue方法如下所示
if ([[segue identifier] isEqualToString:@"register"] || [[segue identifier] isEqualToString:@"forgotPassword"]) {
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:[segue destinationViewController]];
appDelegate.window.rootViewController = navController;
}
Run Code Online (Sandbox Code Playgroud)
设置断点显示该方法仍然被称为corectly,但在prepareForSegue完成后,应用程序崩溃并出现上述错误.有人能指出我正确的方向吗?
非常感谢马丁