Reputation: 63
At runtime my app is throwing this error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x84231f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key count1.
The count1 in question is a label property.
@property (strong, nonatomic) IBOutlet UILabel *count1;
I link to it in the .xib file, I have commented out every single use of the property except for the declaration but the error persists. If I remove the property altogether I get the same exception problem but the key is now 'view' instead of count1.
Why is this happening and how can I fix it?
Upvotes: 0
Views: 80
Reputation: 90671
The property is being accessed on UIApplication
. Wherever you declared count1
, it was not on UIApplication
. It might have been a custom subclass of UIApplication
, but you can't have changed UIApplication
itself.
So, either something is attempting to access the count1
property on the application object when you meant it to access it on some other object, or you meant to use a custom application object but you're not actually doing so. If you intend to use a custom subclass of UIApplication
for your application object, be sure to pass that class's name to UIApplicationMain()
. Otherwise, you have probably connected an outlet incorrectly.
Upvotes: 1