This is for the specific error: NSUnknownKeyException in iOS (Swift and Objective-C)
Questions tagged [nsunknownkeyexception]
81 questions
60
votes
5 answers
Uncaught exception: This class is not key value coding-compliant
I'm following a tutorial titled "Swift Tutorial for iOS : NSFileManager Persisting Data", and I've encountered an error around or after the 29 minute mark. When I try running it on the iOS simulator, I receive the error:
Terminating app due to…

marked-down
- 9,958
- 22
- 87
- 150
27
votes
2 answers
xcode error: ...this class is not key value coding-compliant for the key ibShadowedLargeTitleTextAttributes
I keep getting this error. The app worked before I used a color set.
The error says something about ibShadowedLargeTitleTextAttributes. I dont have any color set for the large title shadow, I am using the default (clear). I restarted Xcode, used a…

WalterBeiter
- 2,021
- 3
- 23
- 48
16
votes
5 answers
Swift: App terminating due to uncaught exception 'NSUnknownKeyException'
I'm developing a simple game and I am having trouble when a particular UIViewController (called SPSwipes.swift) is loaded. On the screen, there are three buttons: 5, 10, and 25. When one is picked, a variable is set in that scene and the player…
user4072094
7
votes
2 answers
Handle uncaught exception valueForUndefinedKey in Swift
I have a third party library class whose source is not open to me. For example like this:
class MyClass: NSObject {
let myProperty = 10
}
I can get myProperty value like this.
let test = MyClass().value(forKey: "myProperty") // 10
I want to…

Warif Akhand Rishi
- 23,920
- 8
- 80
- 107
6
votes
4 answers
Swift NSUnknownKeyException
Started learning Swift a day or two ago. I run into this error more times than I'd like -- essentially, I realize that it has something to do with the IBOutlets. Removing all outlets and buttons/objects in the storyboard, and manually re-adding them…

boisterouslobster
- 1,283
- 3
- 25
- 54
5
votes
2 answers
'NSUnknownKeyException': this class is not key value coding-compliant for the key
I got this message:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key newCell.'
How do I solve it?

MortadaAK
- 51
- 1
- 2
5
votes
3 answers
˜this class is not key value coding-compliant for the key˜ when creating a new Target
I have a big base project for iOS done in Swift. Now I was trying to create different client version by creating a new Targets:
BaseProject (Works just fine, unless I change it's name)
Client1 (NSUnknownKeyException after launch screen).
The base…

CFlux
- 346
- 4
- 9
5
votes
4 answers
This class is not key value coding-compliant for the key Label
I am using a custom UITableViewCell which already has a few UI elements on it that completely work. However, I just tried adding two labels to them and when I hook up the outlet and call cell.label.text = @"text";, the program crashes with the…

random_0620
- 1,636
- 5
- 23
- 44
3
votes
2 answers
How to catch NSUnknownKeyException in swift 2.2?
I have a code where I want to set value for key as following:
item.setValue(field.1, forKey: field.0)
and I want to catch if the NSUnknownKeyException is thrown but I have the following code and it is not working:
do {
try…

Miguelme
- 609
- 1
- 6
- 17
3
votes
1 answer
NSUnknownKeyException while using SearchBar. this class is not key value coding-compliant for the key name
I've had a look through posts that other people have posted with this sort of error, but non in a UISearchBar, and none that I can relate my issue to:
In short, I'm playing with searchBars and trying to build the basics.
I have 2 arrays
@interface…

Jon M
- 530
- 5
- 17
3
votes
2 answers
iOS - Custom View that can contain other views
For a while I've been using custom cells (with their own nibs) for tables without issues. Now in a new project I see the need for a reusable custom view (not a cell) the would have a title, a button, and another UIVIew to hold more views. I'll call…

RobertoCuba
- 881
- 9
- 25
2
votes
1 answer
iOS this class is not key value coding-compliant for the key label
So I'm new to iOS programming and I've run into a problem.
I created a new view controller, and clicked the checkmark to auto make a .xib file for it. In the xib file I put a label, that I want to fade in. So I tried linking it to my custom view…

MrRevolutionzz
- 29
- 1
- 4
1
vote
0 answers
NSUnknownKeyException with Firebase
enter image description hereenter image description hereHere is my my Xcode project. I have already hooked this up to firebase, but I keep getting the error:
2017-11-28 12:37:38.478475-0500 RatFinder_ios[1099:21397] ***
Terminating app due to…

Fhead
- 11
- 2
1
vote
0 answers
Facebook login crashes my app due to NSException
So with the updated Facebook SDK to enable a user to login to my app, I seem to not be able to get it to work properly! I am using code based off of Firebase's guide since that is what I am trying to integrate it with.
I am getting frustrated with…

blakejet1
- 83
- 9
1
vote
1 answer
Swift NSUnknownKeyException FoodTracker
I'm just beginning to learn swift, and I have trouble understanding what the console is trying to tell me with this error. I'm following the Apple's guide to learn swift and in the section "Connect the UI to Code" I'm having the following problem:…

Tom Piaggio
- 650
- 8
- 27