setValue:forUndefinedKey: this class is not key value coding-compliant for the key [duplicate]
Such inexplicable exceptions are often a result of an unclean xib
file.
Open the xib
in xcode, select File's Owner and click on the "Connection Inspector" (upper right arrow), to see all outlets at once.
Look for !
s which indicates a missing outlet.
Check your connections in Interface Builder.
You're probably referring to a non existent IBOutlet
or IBAction
.
Thanks guys. I solved this problem through your help. So, I hope this screenshot helpful to person who have same problem.
Go to Xcode's breakpoints tab. Use the button at the bottom to add an exception breakpoint. Now you'll see what code is invoking setValue:forKey: and the associated stack. With luck that'll point you straight at the problem's source.
Odd that your class is LoginScreen, yet the error is saying someone is using "LoginScreen" as a key. Check that LoginScreen.m is part of your target.
Footnote: with Swift a common problem arises if you change the name of a class (so, you rename it everywhere in your code). Storyboard struggles with this, and you usually have to re-drag any connections involving that class. And in particular, re-enter the name of the class anywhere used in IdentityInspector tab on the right. (In the picture example I deliberately misspelled the class name. But the same thing often happens when you rename a class; even though it's seemingly correct in IdentityInspector, you need to enter the name again; it will correctly autocomplete and you're good to go.)
I had similar issue with creating custom TableCell. The issue was that I set FileOwner to my custom class and then connected outlets.
FileOwner should remain NSObject.