类不是键值编码兼容的键 [英] The class is not key value coding-compliant for the key

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

问题描述

我目前正在学习如何编写iPhone,虽然开始的iPhone 4开发书由Jeff LaMarche但是遇到一个问题,我似乎不能看到问题在哪里。我在许多论坛上看到说,这是一个问题,IBOutlets没有正确连接,但我已经尝试了很多次,问题不消失,所以我在这里请求帮助。

I'm currently learning how to code for iPhone though the Beginning iPhone 4 development book by Jeff LaMarche but have come across a problem that I cannot seem to see where the problem lies. I have read on many forums saying that this is a problem with IBOutlets not being connected correctly but I have tried it many times and the problem does not go away so I'm here asking for help.

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x4b3c2a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key datePicker.'


推荐答案

打开你的nib文件,检查datepicker插座是否连接到你的UIDatepicker。这个问题出现当引用插座没有设置。

Open your nib file and check whether datepicker outlet is connected to your UIDatepicker .This problem arises when referncing outlet not set.

请按照以下步骤操作
1.打开您的MainWindow笔尖。
2.选择DataPickerViewController。
3.将其类(Alt + 4)更改为DataPickerViewController(目前为UIViewController)。
4.保存Nib并运行,将工作。

Please follow this steps 1. Open your MainWindow nib. 2. Select DataPickerViewController. 3. Change Its Class(Alt+4) to DataPickerViewController (Currently it's UIViewController). 4.Save the Nib and run, will work.

这篇关于类不是键值编码兼容的键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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