空项目错误:“此类与视图控制器的键值编码不兼容。”

发布于 2024-11-17 12:23:27 字数 899 浏览 2 评论 0原文

这个错误让我发疯。我已经花了几个小时来解决这个问题,不幸的是没有成功。 我在模拟器中测试了我的应用程序,一切正常。我正在我的设备(iPhone 4 和 ios 4.3.3)上测试它,应用程序无法启动。

所以我尝试创建一个新项目,构建并运行。错误的结尾现在显示键窗口而不是视图控制器。

为了获得有关错误的更多信息,我设置了一个异常断点,该断点在抛出异常和所有异常时都会中断。现在发生了一些有趣的事情:当我在 iPhone 上启动空项目时,我收到警告: 警告:无法读取 /Users/xxx/Library/Developer/Xcode/DerivedData/testing-cmaekkzgdqyseidlqkorvrdvvodg/Build/Products/Debug-iphoneos/OLDAPP.app/testing 的符号(未找到文件)。 (我正在运行的应用程序称为 testapp,而不是 OLDAPP?!这是我的最后一个项目!)

现在出现了一些进一步的错误: Interface Builder 文件中的未知类 OLDAPPAppDelegate。Interface Builder 文件中的未知类 RootViewController。

我清理了所有目标并进行了干净的构建。没有任何变化...

我没有更改 IB 中的任何内容,只是编辑了配置文件以在手机上运行该应用程序。

非常感谢这里的帮助:-)希望有人能帮助我,我将非常感激。

整个错误消息:*** 由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:“[” setValue:forUndefinedKey:]: 该类不符合键窗口的键值编码。'

this error drives me crazy. I already spent hours on fixing this, unfortunately without success.
I tested my app in simulator, everything works fine. I'am testing it on my device (iphone 4 with ios 4.3.3) the app won't start.

So I tried creating a new project, build and go. And the end of the error now says instead of viewcontroller, key window.

To get further information about the error I setup an exeption breakpoint whicht breaks on throw and on all exeptions. Something interesting happend now: when I am launching the empty project on my iphone I get a warning:
warning: Unable to read symbols for /Users/xxx/Library/Developer/Xcode/DerivedData/testing-cmaekkzgdqyseidlqkorvrdvvodg/Build/Products/Debug-iphoneos/OLDAPP.app/testing (file not found). (The app which I am runnning is called testapp, not OLDAPP?! This was my last project!)

Some further errors now occure:
Unknown class OLDAPPAppDelegate in Interface Builder file. and Unknown class RootViewController in Interface Builder file.

I did clean all targets and made a clean build. Nothing changes…

I didn't change anything in IB, just edited the provisioning profile to run the app on my phone.

Help is very appreciated here :-) Hopefully someone can help me I would be really thankful.

The whole error message: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x18b410> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

铁轨上的流浪者 2024-11-24 12:23:27

如果我更改 ViewController 上连接到 Interface Builder 中视图中某些内容的插座名称,就会发生这种情况。例如,将“labelFirstName”重命名为“lblFirstName”,却忘记在 IB 中断开并重新创建连接。

This happens to me if I change the name of an outlet on the ViewController which was connected to something in the View in Interface Builder. For example, renaming 'labelFirstName' to 'lblFirstName' and forgetting to break and recreate the connection in IB.

野の 2024-11-24 12:23:27

我遇到了同样的问题,我的 XIB 中没有 !,也没有重命名问题。为了解决这个问题,我刚刚创建了一个新的 XIB,从旧的 XIB 复制到视图中,并重新连接了所有连接。

I had the same problem where there were no !'s in my XIB and no re-naming problems. To fix it, I just created a new XIB, copied in the view from the old XIB, and rewired all the connections.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文