這個問題在ios6.0以前的版本中運行會出現,由於使用Xcode 4.5以後的版本新建項目默認是選中AutoLayout的,但這個特性是在iOS6.0以後的版本中才支持的。ios
解決辦法是選中.stroyborad或.xib文件,將Interface Builder Document下的「Use Autolayout」去掉。app
注意若是工程中有許多的.xib文件是每一個都要去掉的!!ui
錯誤日誌輸出以下:spa
2013-09-07 14:56:41.568 GeneralProject_ARC[83404:c07] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint' *** First throw call stack: (0x230d052 0x1cfdd0a 0x22b5a78 0x22b59e9 0x13d07d7 0x13d09af 0x13d06b7 0x12d136d 0x1178e2c 0x11793a9 0x11795cb 0x1178c1c 0x119f56d 0x1189d47 0x11a0441 0x11a045d 0x11a04f9 0x10e0d65 0x10e0dac 0x2fd2 0x10b19d6 0x10b28a6 0x10c1743 0x10c21f8 0x10b5aa9 0x347cfa9 0x22e11c5 0x2246022 0x224490a 0x2243db4 0x2243ccb 0x10b22a7 0x10b3a9b 0x2ce2 0x2c15) terminate called throwing an exception