应用程序在iOS 6上工作,但不适用于iOS 5

ato*_*nda 1 iphone xcode objective-c ios ios5

可能重复:
presentViewController:在iOS上崩溃<6(AutoLayout)
如何在iOS 6中使用NSLayoutConstraint?
应用无法加载

我刚刚开始研究iOS6 SDK中的应用程序,它在iOS 6设备和iOS 6模拟器上运行顺畅,但它不能在iOS 5或iOS 5模拟器上运行.我已将部署目标设置为:5.0

这是它试图打开时给我的错误,但它失败了......

2013-01-02 14:22:57.075 MyApp[34956:c07] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x14a5052 0xea5d0a 0x144da78 0x144d9e9 0x3327d7 0x3329af 0x3326b7 0x23336d 0xdae2c 0xdb3a9 0xdb5cb 0x3ba73 0x3bce2 0x3bea8 0x42d9a 0x2845 0x139d6 0x148a6 0x23743 0x241f8 0x17aa9 0x138ffa9 0x14791c5 0x13de022 0x13dc90a 0x13dbdb4 0x13dbccb 0x142a7 0x15a9b 0x257d 0x24a5)
terminate called throwing an exception(lldb) 
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

roo*_*117 5

您正在使用AutoLayout,这是仅在iOS6中可用的功能.您需要将iOS版本限制为iOS6,或者您需要通过进入.xib或故事板并禁用它来禁用AutoLayout.