The class is not a key value compatible with the key code.

I am currently studying code for the iPhone, although Jeff LaMarche’s iPhone 4 starter book, but ran into a problem that seems to be unable to figure out where the problem is. I read in many forums saying that this is a problem with IBOutlets not connecting correctly, but I have tried it many times and the problem does not disappear, so I ask for help here.

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

Open your nib file and check if the datepicker output point is connected to your UIDatepicker. This problem occurs when the output connector is not installed.

Please follow these steps. 1. Open your MainWindow nib. 2. Select a DataPickerViewController. 3. Change your class (Alt + 4) to a DataPickerViewController (currently it is a UIViewController). 4.Save the Nib and run, it will work.

+7
source

All Articles