gpt4 book ai didi

objective-c - NSInvalidUnarchiveOperationException : Could not instantiate class named NSLayoutConstraint

转载 作者:IT老高 更新时间:2023-10-28 12:16:53 25 4
gpt4 key购买 nike

我对此很陌生。我按照 Apple 的 iPhone 项目“HelloWorld”教程一步一步来。我在 iPhone 5.0 模拟器中运行它,它崩溃了:

2012-11-02 14:46:06.782 HelloWorld[9880:c07] * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint' * First throw call stack: (0x14a2052 0xea2d0a 0x144aa78 0x144a9e9 0x32f7d7 0x32f9af 0x32f6b7 0x23036d 0xd7e2c 0xd83a9 0xd85cb 0x38a73 0x38ce2 0x38ea8 0x3fd9a 0x10be6 0x118a6 0x20743 0x211f8 0x14aa9 0x138cfa9 0x14761c5 0x13db022 0x13d990a 0x13d8db4 0x13d8ccb 0x112a7 0x12a9b 0x1fed 0x1f15 0x1) terminate called throwing an exception(lldb)

谁能告诉我出了什么问题?我正在使用 Xcode 4.5。

最佳答案

默认情况下,当您在 Xcode 4.5 中创建新的 iOS 项目时,您的 Storyboard或 XIB 设置为使用 Autolayout,这是 iOS 6.0 中的新功能。 NSLayoutConstraint 类是 Autolayout 系统的一部分,在旧版本的 iOS 中不存在。

如果您想将您的应用部署到旧版本的 iOS,您需要将您的 Storyboard或 XIB 更改为使用自动布局。这是文件检查器中的一个复选框:

turning off autolayout

关于objective-c - NSInvalidUnarchiveOperationException : Could not instantiate class named NSLayoutConstraint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13201586/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com