应用程序由于未捕获异常而终止NSUnknownKey异常,键值不符合编码 [英] App terminating due to uncaught exception NSUnknownKey Exception , key value not coding compliant

查看:488
本文介绍了应用程序由于未捕获异常而终止NSUnknownKey异常,键值不符合编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于提出这样一个简单的问题,对不起,但我是一个初学者

Sorry for asking such an easy question, but im a beginner

我是在一个关于构建应用程序的教程。
我创建了一个按钮,但我不小心命名为错误,我命名它,而不是在创建插座。我命名它,虽然当我创建的动作。我运行我的应用程序,它失败了,因为我的实例调用,不是(至少我认为这就是为什么我的应用程序崩溃所以删除了插座和自动代码xcode写的插座,我重新创建插座,并命名它正确的但现在当我运行我的应用程序终止,回到报告:

I was following a tutorial on building apps. I was creating a button, but i accidently named it wrong, i named it instead of when creating the outlet. I named it right though when i created the action. I ran my app and it failed, because my instances called on , not (at least i think thats why my app crashed. So deleted the outlet and and the automatic code xcode writes for the outlet, i remade the outlet and named it right this time. But now when i run my app it terminates, heres the report:

2012-08-21 20:42:07.602 FieldButtonFun [973:c07] *
* 第一次调用堆栈:第一次调用堆栈:第一次调用堆栈:第一次调用堆栈:
(0x14b2022 0xeb2cd6 0x14b1ee1 0x9c3022 0x934f6b 0x934edb 0x94fd50 0x23771a 0x14b3dea 0x141d7f1 0x23626e 0xdc1fc 0xdc779 0xdc99b 0x3b401 0x3b670 0x3b836 0x4272a 0x13596 0x14274 0x23183 0x23c38 0x17634 0x139cef5 0x1486195 0x13eaff2 0x13e98da 0x13e8d84 0x13e8c9b 0x13c65 0x15626 0x271d 0x2685)
终止称为抛出异常

2012-08-21 20:42:07.602 FieldButtonFun[973:c07] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key theNutton.' * First throw call stack: (0x14b2022 0xeb2cd6 0x14b1ee1 0x9c3022 0x934f6b 0x934edb 0x94fd50 0x23771a 0x14b3dea 0x141d7f1 0x23626e 0xdc1fc 0xdc779 0xdc99b 0x3b401 0x3b670 0x3b836 0x4272a 0x13596 0x14274 0x23183 0x23c38 0x17634 0x139cef5 0x1486195 0x13eaff2 0x13e98da 0x13e8d84 0x13e8c9b 0x13c65 0x15626 0x271d 0x2685) terminate called throwing an exception

我不知道出了什么问题,我根本不理解错误报告。我以为我已经删除所有自动代码Xcode生成时,我创建了插座,并重新制作。

I have no idea what went wrong and i dont understand the error report at all. I thought i already deleted all the automatic code Xcode generated when i created the outlet and remade it. Could anyone help me and find out what could have went wrong?

我可以从头开始重建这个应用程序,但我想了解为什么出错了,以供将来参考。 / p>

I could rebuild this app from scratch but i want to understand why this went wrong, for future reference.

推荐答案

Xcode找不到键 theNutton code> FieldButtonFun 。

Xcode cannot find the value for the key theNutton in the class FieldButtonFun.

很难说没有看到实际的代码有什么问题。但在大多数情况下,XIB文件中可能有错误的连接。请检查XIB,按住Ctrl键单击文件的所有者,看是否有任何黄色警告。

It's hard to say what's wrong without see the actual code. But in most cases, there could be a bad connection in the XIB file. Please check the XIB, ctrl-click the File's Owner, see if there is any yellow warning.

这篇关于应用程序由于未捕获异常而终止NSUnknownKey异常,键值不符合编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆