在Xcode 4.5下默认生成了个程序,在iOS 5.1的机器上跑,程序运行崩溃。
错误提示如下:
2013-01-10 16:51:28.166 UIAdapter[1814:707] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x358d888f 0x37c7f259 0x358d8789 0x358d87ab 0x335f354d 0x335f36bb 0x335f3423 0x33584001 0x334f23c7 0x333cfc59 0x33345c17 0x33344461 0x33336e87 0x333a77d5 0x327a5 0x33344cab 0x3333e7dd 0x3330cac3 0x3330c567 0x3330bf3b 0x374cb22b 0x358ac523 0x358ac4c5 0x358ab313 0x3582e4a5 0x3582e36d 0x3333d86b 0x3333acd5 0x32439 0x3239c)
terminate called throwing an exception(lldb)
原因:iOS 5 没有 Autolayout 的 功能, 就自动崩溃了
将storyboard 和 xib中的 Use Autolayout选项去掉即可。