Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

[iPhone] this class is not key value coding-compliant for the key view

I hope somebody can help me, I'm totally lost on this:

I've used IB to create a simple and basic view. I've set the File's Owner Identity to my ViewControllers class. My ViewController subclasses UIViewController. I've connected File's Owner view to the View created with IB.

When I launch the application crashes with:

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

I believe what this means is that the class (my ViewController) has no property for "view", so when the IB create view awakes it cannot connect to the ViewController's view property.

If I delete the connection from the actual View to File's Onwer view I don't get the exception. However, I do need programmatic access to the View.

Can anybody help? I don't know what else I could have forgotten. As far as I know I don't have to synthesize the view property or anything, I don't even have to create an IBOutlet as all of that is inherited from UIViewController.

Please help.

iMac, Mac OS X (10.5.4), iPhone 2.1

Posted on Sep 16, 2008 7:25 AM

Reply
14 replies

Nov 2, 2008 8:23 AM in response to jerbeers

I'm having the same problem. I have a TabBarController with two tabs. If I don't set the views to load in Interface Builder, the app opens successfully. If I set one of the tabs to load a View (which I know works because I've tested it independently), the app crashes with:

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

Any ideas? Am I missing a connection somewhere?

Dec 1, 2008 12:32 AM in response to sabernar

This one stumped me a bit too.

To elaborate on sabernar's resolution, if you have a TabBarController with a view that's loaded from a nib, you must set the "Class Identity" of the "Tab View Controller Identity" to the same controller class you've set the "File's Owner" to in the nib that loads the actual view.

That's clear as mud... You have to set the Class Identity in two places, not just in the nib of the view you are loading, but also in the TabBarController nib. I hope this helps someone.

Mar 6, 2009 1:34 AM in response to moss2apple

Wow, that' s awesome, I encountered the same problem with ya today when trying implement Pickers in Tabbar, and can't figure out why, the debugger just throw back such vague message and guess what ? I spent like 3 hours banging my head against the wall wonder why it's not working, I using XCode 2.2.1, my debugger wont work ( program won't stop at break points for what ever I tried ), and not very friendly with those newbie like me - really don't know where are all the Apple's software developer 1337 ? As I remembered, all the good ones goes for the hardware, "the rest" goes for the software =)), but thanks again, thanks, and again, click the tab bar, set both the class and nib file would get rid of the errors, if it would help some one, the credit goes to the two above, say thanks to them, like me. Have a nice day guys, I 'ma happy 😀.

May 16, 2009 1:03 PM in response to BeSharp

I'm having this exact problem working though the Mark and LaMarche Beginning iPhone Development book.

Sorry, but I'm not understanding what to fix. I get that something has to be set in two places. I'm having this error in one project with a text box.

Please explain exactly where and what I need to change. The object is called statusText.

Thanks

2009-05-16 15:52:32.267 ButtonFun[981:20b] Unknown class ButtonFunViewController in Interface Builder file.
2009-05-16 15:52:32.271 ButtonFun[981:20b] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x525cd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key statusText.'

Message was edited by: Brooks R

[iPhone] this class is not key value coding-compliant for the key view

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.