问题
Application is made in Interface builder. Seperate storyboards for iPhone and iPad. Project runs and works properly on iPhone Simulator, iPad Simulator, iPhone 4 with newest iOs, but I get this error when I build it on 'new iPad' spring 2012 with iOs 5.1. Fix/explanation?
2012-12-12 16:44:16.763 LNG[397:707] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x32b7488f 0x34b19259 0x32b74789 0x32b747ab 0x3536254d 0x353626bb 0x35362423 0x352f3001 0x352613c7 0x3513ec59 0x350b4c17 0x350b3461 0x350a5e87 0x351167d5 0x350b3e6d 0x350ad7dd 0x3507bac3 0x3507b567 0x3507af3b 0x32c1822b 0x32b48523 0x32b484c5 0x32b47313 0x32aca4a5 0x32aca36d 0x350ac86b 0x350a9cd5 0x84ad 0x8448)
terminate called throwing an exception(lldb)
回答1:
The new autolayout
mechanism is iOS 6.0+ only, and the device it is crashing on is 5.1.
To fix it, load the XIB in Interface Builder, select the File Inspector tab, and uncheck Use autolayout
. Alternatively, you can target iOS 6.0+
-only devices and change the minimum target, if you absolutely must have autolayout.
来源:https://stackoverflow.com/questions/13843466/nslayoutconstraint-sigabrt-on-ipad