为了账号安全,请及时绑定邮箱和手机立即绑定

presentViewController:在iOS <6(AutoLayout)上崩溃

presentViewController:在iOS <6(AutoLayout)上崩溃

当年话下 2019-12-26 09:01:54
这是我遇到的怪异崩溃。当我按下转到某个ViewController的按钮时,发生崩溃。它崩溃的行是:DestinationInformationViewController *info = [[DestinationInformationViewController alloc] init];[info setModalTransitionStyle: UIModalTransitionStyleCrossDissolve];[self presentViewController:info animated:YES completion: nil]; // CRASHES HERE[info release];崩溃跟踪为:*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'*** First throw call stack:(0x3758288f 0x35287259 0x37582789 0x375827ab 0x3153d54d 0x3153d6bb 0x3153d423 0x314ce001 0x3143c3c7 0x31319c59 0x3128fc17 0x3129a267 0x3129a1d5 0x3133959b 0x31338367 0x84091 0x374dc3fd 0x31271e07 0x31271dc3 0x31271da1 0x31271b11 0x31272449 0x3127092b 0x31270319 0x31256695 0x31255f3b 0x33c9822b 0x37556523 0x375564c5 0x37555313 0x374d84a5 0x374d836d 0x33c97439 0x31284cd5 0x82bb3 0x71200)terminate called throwing an exception(gdb) Could not instantiate class named NSLayoutConstraint注意:这会在我的iPhone 4 iOS 5.1上崩溃,但不会在我的iPhone 4S iOS 6 Beta 2上崩溃
查看完整描述

3 回答

?
HUWWW

TA贡献1874条经验 获得超12个赞

下载新的XCode更新和IOS6 SDK时遇到相同的问题。这是我解决的方法:

选择发生错误的“界面”构建器文件(无论是xib还是情节提要文件)。在XCode右侧的助手编辑器中,从左侧选择第一个选项卡,然后有一个复选框“ Use Autolayout”,如上面的屏幕截图所示。取消选中该复选框。


查看完整回答
反对 回复 2019-12-26
  • 3 回答
  • 0 关注
  • 607 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信