pushViewController无法在iOS 5上工作(iOS 6上的确定)

我有一个UINavigationController,在屏幕上显示几个button。 他们都只是使用该行:

myViewController *newView = [[myViewController alloc] initWithNibName:@"myViewController" bundle:nil]; [[self navigationController] pushViewController:newView animated:YES]; 

转换到下一个视图。 我有一个这样的视图控制器,但是导致在这个只在iOS 5上的线崩溃。它在iOS 6上完美的罚款。我感到困惑。 没有真正的细节崩溃。 这是一个强调main.m行的SIGABRT:

 exitStatus = UIApplicationMain( argc, argv, nil, NSStringFromClass([ApplicationDelegate class])); 

我没有任何线索…

  1. 您需要取消检查自动布局。

在这里输入图像说明

  1. 并确保你也在这里改变..selectIOS 5.1

在这里输入图像说明

试试这一行:

 myViewController *newView = [[myViewController alloc] initWithNibName:@"myViewController" bundle:[NSBundle mainBundle]]; 

代替:

 myViewController *newView = [[myViewController alloc] initWithNibName:@"myViewController" bundle:nil]; 

我已经尝试过类似的问题,下面是我觉得需要考虑的步骤:

  • (如果你正在使用xib文件),像Venkat Manohar Perepa提到的那样,检查Use Auto Layout是否被closures,因为它是iOS 6特有的function。
  • (如果你使用的是xib文件)查看呈现viewcontroller时使用的xib文件的内容,并检查是否没有与iOS6相关的类(例如:NSLayoutConstraint)
  • 最后(这是我面临的问题)你应该检查崩溃是否出现在安装了iOS5的设备上。 如果它不在模拟器上仍然崩溃,请通过selectiPhone Simulator> Reset Content and Settings来移除已安装的应用程序。