I am making an App in Xcode and i have been getting the error
"Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key achiev"
recently. I have been searching for hours and i cannot seem to find an answer that matches my case. This error happened when i added new objects and removed some objects in the .h file but i have double-triple-quadruple checked that every single outlet is connected rightly. Nothing is phantom connected or not connected, everything is all good. When i tried to remove the key mentioned in the error code, it went to the next key and it kept on, basically every single connection is bad. I have connected the view properly (i think) since when i add new outlets in the .h file i am able to see it in the xib file and connect it, but every time i open the app i still get this error.
i recently changed the view controller id thingy to XcodeProjectViewController and i have checked all my files (h, m and xib) to see that they are matching.
I encountered this error message in my latest app, Label Dispenser PRO. It is pretty annoying because all codes seems ok (because they are).
After a few hours of investigating, it turns out (for my case) the problem was I specified (accidentally?) XIB files as Main Interface for the "iPad development info" section in Target's Summary area. Here's the pic to illustrate this location:
Deleting this field solved the problem. I guess this happens because compiler is confused since I was manually presenting the XIB based on if statement evaluating "if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)" in the AppDelegate.
Hope this helps someone. Cheers.
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