NSUnknownKeyException IPhone

Terminating app due to uncaught exception ‘NSUnknownKeyException‘, reason: ‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key your_property_name.

NSUnknownKeyException

You can face NSUnknownKey Exception during your I Phone development. This exception occurs if you created an outlet connection for any controll. I named it your_property_name.

@property (weak, nonatomic) IBOutlet UIButton *your_property_name;

So if you rename your property or delete that outlet then you can face this exception. Because you have deleted that property but compiler still looking that outlet.

Soution of NSUnknownKey Exception

[sociallocker]

 

Go to your xib file or story board click on File’s Owner

i-phone-files-owner

and switch to Connections Inspector

iphone-connections-explorer

It will show your property is still connected so just remove the connection from there (click on delete icon)

[/sociallocker]

Leave a comment

Your email address will not be published. Required fields are marked *