我目前正在学习如何编写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.
更多推荐
类不是键值编码兼容的键
发布评论