setValue:forUndefinedKey:]:

setvalue:forundefinedkey:]: this class is not key value coding-compliant for the key
setvalue:forundefinedkey nsdictionary
this class is not key value coding-compliant for the key swift 5
nsunknownkeyexception
this class is not key value coding-compliant for the key objective c
this class is not key value coding compliant for the key false button
nsunknownkeyexception', reason
this class is not key value coding-compliant for the key view xib
FinalViewWithSending *newView = [[FinalViewWithSending alloc]initWithNibName:@"FinalViewWithSending" bundle:nil];
newView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:newView animated:YES]; //it crashes here with a thread 1 error, SIGABRT error..

It says:

"Terminating app due to uncaught exception 'NSUnknownKeyException', 
reason: '[<FinalViewWithSending 0x1bef70> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key loginButton.'"

There is no variable called loginButton so Im not sure why i am getting an error...

Thank you


You are getting the error because there is no property called loginButton. Check your .xib file. There is almost certainly a bad link to a FinalViewWithSending object (likely File's Owner) that specifies loginButton even though it doesn't exist in the class code.

setValue:forUndefinedKey:, setValue:forUndefinedKey: Invoked by setValue:forKey: when it finds no property for a given key. Availability. iOS 2.0+; macOS 10.3+; Mac Catalyst 13.0+; tvOS  Sets the value for the property identified by a given key path to a given value.


Phillip Mills is correct.

The answer here, for anyone searching, is to edit the storyboard and remove any link to the undefined key specified. You have to edit the storyboard file in an external editor: Right click on the storyboard listing in the hierarchy and then click on "show in finder" or what have you. Open in a text editor, remove said links by searching, save and return to Xcode. No more issue.

This happens when you remove something from the view controller improperly.

UIViewController not key value coding-compliant · Issue #29 · 52inc , Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x143d485f0> setValue:forUndefinedKey:]: this class is not  2015-03-03 19:55:52.507 demos[24988:4604020] Failed to set (animation) user defined inspected property on (UIView): [<UIView 0x7a8860b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animation.


Agreeing here - Phillip Mills is correct.

Someone mentioned opening the storyboard up in a text editor - this isn't necessary.

Just click on the storyboard, go to the Connections Inspector. If you've got a problematic outlet, you'll see an exclamation marker next to the outlet. Delete it.

Crash with "setValue:forUndefinedKey:]: this class is not key value , Crash with "setValue:forUndefinedKey:]: this class is not key value coding-​compliant" #624. Closed. akring opened this issue on Oct 15, 2015 · 3 comments. Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ButtonIn.' Code: import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically


Since this is the first search result for this error, I decided to write an answer for rookies like me.

You are going to get this error if you have Ctrl dragged connections from Buttons which generates code in your ViewController and then you delete just the code without removing the connection.

I got this error because I had accidently added a few buttons as Outlets, when I wanted to add them as Actions. I deleted the code that got generated but the bad connections were still there.

To find and remove them, View->Utilities->Show Connections Inspector

Then click through the different buttons you have and click the x to remove the bad connections.

FIXED: this class is not key value coding-compliant for the key , Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '​[<UIViewController 0xXXXXXX> setValue:forUndefinedKey:]:  Day 54 - Instafilter, part 4Applying filtersError: "Thread 1: Exception: "[<CITwirlDistortion 0x600002ccea00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key inputIntensity." Forums > 100 Days of Swift


If you have any localizations, search for bad links in all the storyboards (expand storyboard to find localized storyboards).

This was my situation. I was looking for bad links in one storyboard and they were in the localized one.

[ setValue:forUndefinedKey:]: this class is not key value coding , setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key yourIBOutletKey. Go to Xib file, click file owner, and check  Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8a45930> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key departmentbox.'


This class is not key value coding-compliant for the key , 0x7fcfe9c90500> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key playlistImageView0.' I've usually found  In this tutorial we will learn how to fix "this is not key value coding-compliant for the key". This is a quite a common problem with new developers and the issue occurs when the user interface which is created with Interface Builder and the code do not match up, specifically with regards to IBOutlet's.


setValue:forUndefinedKey error : swift, could respond like im 5 years old, it would be great. "setValue:forUndefinedKey​:]: this class is not key value coding-compliant for the key. VIEW CONTROLLER  '[<IASKAppSettingsViewController 0x201c1400> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _tableView.' The stack-trace shows: [IASKAppSettingsViewController init]


about NSDictionary question - Compiler, I defined a instance of NSDictionary, when I set value to this instance , it throw a '[<__NSDictionary0 0x7fc430404810> setValue:forUndefinedKey:]: this Try using setObject(forKey:) rather than setValue(forUndefinedKey:). "setValue:forUndefinedKey" XCODE 9.1, Swift 4 #8. Closed alihaider525 opened this issue Dec 6, 2017 · 10 comments Closed