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.'
You can fix the error by breaking the connection that is causing the problem. Simply click the X to delete the outlet. Then you can go back to the View Controller and simply recreate the connection. Just hold the control key and drag and drop the mouse pointer to the outlet you want to connect.
About Key-Value Coding. Key-value coding is a mechanism enabled by the NSKeyValueCoding informal protocol that objects adopt to provide indirect access to their properties. When an object is key-value coding compliant, its properties are addressable via string parameters through a concise, uniform messaging interface.
Open your nib file and check whether datepicker outlet is connected to your UIDatepicker .This problem arises when referncing outlet not set.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With