如何解决'NSUnknownKeyException'... setValue:forUndefinedKey:]:...不是键值编码兼容 [英] How do I solve a 'NSUnknownKeyException' ... setValue:forUndefinedKey:]: ...not key value coding compliant

查看:165
本文介绍了如何解决'NSUnknownKeyException'... setValue:forUndefinedKey:]:...不是键值编码兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我会尽量让这个简短的。我想要一个UIToolbar在我的键盘上面,它需要我一段时间才能看出来,我最终做到了,但是当我尝试添加功能到上一步 * next *和 done

Alright, I'll try and make this brief as possible. I wanted to a UIToolbar above my keyboard, and it took me a while to figure it out, and I eventually did, but when I tried adding function to the buttons previous *next* and done my program would soon not compile.

整个错误讯息可以在这里看到:

The entire error message can be seen here:


2012-06-20 05:36:55.276 KegCop [79460:fb03] * 由于未捕获异常NSUnknownKeyException终止应用程序,原因:'[setValue:forUndefinedKey: :

2012-06-20 05:36:55.276 KegCop[79460:fb03] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key done.'

第一次调用堆栈:
(0x134a022) 0x1733cd6 0x1349ee1 0xd31022 0xca2f6b 0xca2edb 0xcbdd50 0x5a571a 0x134bdea 0x12b57f1 0x5a426e 0x7adeef 0x7ae03e 0x382d7a 0x382ff8 0x38217f 0x391183 0x391c38 0x385634 0x1f84ef5 0x131e195 0x1282ff2 0x12818da 0x1280d84 0x1280c9b 0x381c65 0x383626 0x2a8d 0x29f5为0x1)
终止叫做抛出异常(LLDB)

* First throw call stack: (0x134a022 0x1733cd6 0x1349ee1 0xd31022 0xca2f6b 0xca2edb 0xcbdd50 0x5a571a 0x134bdea 0x12b57f1 0x5a426e 0x7adeef 0x7ae03e 0x382d7a 0x382ff8 0x38217f 0x391183 0x391c38 0x385634 0x1f84ef5 0x131e195 0x1282ff2 0x12818da 0x1280d84 0x1280c9b 0x381c65 0x383626 0x2a8d 0x29f5 0x1) terminate called throwing an exception(lldb)

@Abizern建议我阅读 Apple Doc on Key value coding guide 。无论如何,它是超级晚,或超级早期,但你看看它。已更新的项目可以在这里找到: https://github.com/ipatch/KegCop

@Abizern suggested I should read the Apple Doc on Key value coding guide. Anyways it's super late, or super early however you look at it. The updated project can be found here: https://github.com/ipatch/KegCop

只需下载zip,并尝试构建,你会看到我在说什么。错误可能位于 ViewControllerWelcome.m 文件中。

Just download the zip, and try and build and you will see what I am talking about. The error probably lies somewhere in the ViewControllerWelcome.m file.

推荐答案

查看您的故事板或xib (您使用的)对于 ViewControllerWelcome 对象。此错误的最可能的原因是某个操作或插口与 done 的连接不存在于该类的代码中。

Look in your storyboard or xib (whichever you're using) for the ViewControllerWelcome object. The most likely source of this error is that something has a connection to an action or outlet called done that doesn't exist in the code for that class.

这篇关于如何解决'NSUnknownKeyException'... setValue:forUndefinedKey:]:...不是键值编码兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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