如何解决'NSUnknownKeyException'... setValue:forUndefinedKey:]:...不是键值编码兼容

编程入门 行业动态 更新时间:2024-10-05 07:27:54
本文介绍了如何解决'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 。无论如何,它是超级晚,或超级早期,但你看看它。已更新的项目可以在这里找到: github/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: github/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:]:...不是键值编码兼容

本文发布于:2023-11-26 18:59:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634795.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何解决   键值   NSUnknownKeyException   setValue   forUndefinedKey

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!