This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
Everytime I create an outlet for a UITextField it breaks my app. No build errors just termination at boot.
"2015-11-27 17:34:19.005 ticTacToe[3540:71629] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x7fbb82682450> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key wins.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010d8b0c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c003bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010d8b08a9 -[NSException raise] + 9
3 Foundation 0x000000010bb99b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x000000010d7f8d50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010c51d4eb -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x000000010c3756d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x000000010c375cc8 -[UIViewController loadView] + 109
8 UIKit 0x000000010c375f39 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x000000010c3763ce -[UIViewController view] + 27
10 UIKit 0x000000010c291289 -[UIWindow addRootViewControllerViewIfPossible] + 58
11 UIKit 0x000000010c29164f -[UIWindow _setHidden:forced:] + 247
12 UIKit 0x000000010c29dde1 -[UIWindow makeKeyAndVisible] + 42
13 UIKit 0x000000010c241417 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732
14 UIKit 0x000000010c24419e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
15 UIKit 0x000000010c243095 -[UIApplication workspaceDidEndTransaction:] + 179
16 FrontBoardServices 0x0000000111bc95e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
17 CoreFoundation 0x000000010d7e441c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
18 CoreFoundation 0x000000010d7da165 __CFRunLoopDoBlocks + 341
19 CoreFoundation 0x000000010d7d9f25 __CFRunLoopRun + 2389
20 CoreFoundation 0x000000010d7d9366 CFRunLoopRunSpecific + 470
21 UIKit 0x000000010c242b02 -[UIApplication _run] + 413
22 UIKit 0x000000010c2458c0 UIApplicationMain + 1282
23 ticTacToe 0x000000010b6f386f main + 111
24 libdyld.dylib 0x000000010eaac145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException"
If possible please explain fix visually as I am programming retarded :-)
Further to Hayden's answer - you can easily check to see if any IBOutlets which you think should be connected to your View Controller are actually not connected by looking at the margin in Xcode (as below). Each IBOutlet will display a filled in circle showing you that it's connected to an element on the storyboard.
If the circle is empty it's not connected which can cause a crash...
Related
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 6 years ago.
For some reason when I run my app , the app crashes then in Xcode it takes me to app delegate. The error message is given to me at the top(where "the class AppDelegate: UIResponder, UIApplicationDelegate" is). The error message is "Thread 1: Signal SIGABRT". As I am only a novice in programming, I have no idea what this means, and have found no help online. Here are screenshots of what I get in Xcode. This is not the duplicate of the other problem, because my problem was why Xcode takes me to app delegate and shows me the SIGABRT ERROR. I just didn't know what I was supposed to do after that.FYI-I did not know in the console errors pop up there
This is what is my console:
2017-01-23 17:58:27.966 TIP CALCULATOR[53908:2610390] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TIP_CALCULATOR.ViewController 0x7fbc53d0add0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key calculateButtonPressed.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a9a9d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010788321e objc_exception_throw + 48
2 CoreFoundation 0x000000010a9a9c99 -[NSException raise] + 9
3 Foundation 0x00000001073919df -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x000000010830e293 -[UIViewController setValue:forKey:] + 88
5 UIKit 0x000000010858279e -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010a94e9e0 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x0000000108581122 -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x00000001083149c5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x00000001083152e7 -[UIViewController loadView] + 177
10 UIKit 0x000000010831561c -[UIViewController loadViewIfRequired] + 201
11 UIKit 0x0000000108315e70 -[UIViewController view] + 27
12 UIKit 0x00000001081df4b5 -[UIWindow addRootViewControllerViewIfPossible] + 71
13 UIKit 0x00000001081dfc06 -[UIWindow _setHidden:forced:] + 293
14 UIKit 0x00000001081f3519 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x000000010816bf8d -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4818
16 UIKit 0x00000001081720ed -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
17 UIKit 0x000000010816f26d -[UIApplication workspaceDidEndTransaction:] + 188
18 FrontBoardServices 0x000000010c10f6cb __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
19 FrontBoardServices 0x000000010c10f544 -[FBSSerialQueue _performNext] + 189
20 FrontBoardServices 0x000000010c10f8cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
21 CoreFoundation 0x000000010a94e761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x000000010a93398c __CFRunLoopDoSources0 + 556
23 CoreFoundation 0x000000010a932e76 __CFRunLoopRun + 918
24 CoreFoundation 0x000000010a932884 CFRunLoopRunSpecific + 420
25 UIKit 0x000000010816daea -[UIApplication _run] + 434
26 UIKit 0x0000000108173c68 UIApplicationMain + 159
27 TIP CALCULATOR 0x000000010729cf9f main + 111
28 libdyld.dylib 0x000000010b95968d start + 1
29 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Check if there are non valid connections between your UI elements and code in the connections inspector
I can't seem to figure out this Thread 1: signal SIGABRT error. My app stops at the launch screen with only the title displayed. I've checked to see if there are any rogue outlets as mentioned in other solutions but it seems fine. Here is the log:
2016-06-14 12:50:22.760 Flight4[92201:6597548] Unknown class MainViewController in Interface Builder file.
2016-06-14 12:50:22.777 Flight4[92201:6597548] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7f91c0694330> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tableView.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ccb2c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010e81dbb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010ccb28a9 -[NSException raise] + 9
3 Foundation 0x000000010d0d0b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x000000010cbfad50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010d8294eb -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x000000010d6816d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x000000010d681cc8 -[UIViewController loadView] + 109
8 UIKit 0x000000010d681f39 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x000000010d6823ce -[UIViewController view] + 27
10 UIKit 0x000000010d59d289 -[UIWindow addRootViewControllerViewIfPossible] + 58
11 UIKit 0x000000010d59d64f -[UIWindow _setHidden:forced:] + 247
12 UIKit 0x000000010d5a9de1 -[UIWindow makeKeyAndVisible] + 42
13 UIKit 0x000000010d54d417 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732
14 UIKit 0x000000010d55019e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
15 UIKit 0x000000010d54f095 -[UIApplication workspaceDidEndTransaction:] + 179
16 FrontBoardServices 0x0000000112ef65e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
17 CoreFoundation 0x000000010cbe641c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
18 CoreFoundation 0x000000010cbdc165 __CFRunLoopDoBlocks + 341
19 CoreFoundation 0x000000010cbdbf25 __CFRunLoopRun + 2389
20 CoreFoundation 0x000000010cbdb366 CFRunLoopRunSpecific + 470
21 UIKit 0x000000010d54eb02 -[UIApplication _run] + 413
22 UIKit 0x000000010d5518c0 UIApplicationMain + 1282
23 Flight4 0x000000010ca2bc87 main + 135
24 libdyld.dylib 0x000000010f51d145 start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
The first line says "Unknown class MainViewController in Interface Builder file." but the class is linked to a view controller on the main storyboard and does not contain any errors. Could the error be related to this file? If so, I'm not sure how else to proceed. Thanks!
So I found a solution for this problem. I went to the Identity Inspector for MainViewController and under Custom Class, I set the Module which was previously undefined (see photo).
However, now I have a new error:
*** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Must translate autoresizing mask into constraints to have _setHostsLayoutEngine:YES.'
in regards to my cell. I have attached a picture of the view hierarchy.
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 6 years ago.
I'm new to Swift and am experimenting with things such as the stepper. I followed online step-by-step instructions on how to make one but I'm getting an error (Attached below) and I am not quite understanding where the issue is.
Error:
2016-06-04 04:31:15.832 numChsnger[12025:1111078] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<numChsnger.ViewController 0x7fc082695990> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key stepper.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000102328d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001040ccdeb objc_exception_throw + 48
2 CoreFoundation 0x00000001023289c9 -[NSException raise] + 9
3 Foundation 0x00000001026fa19b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
4 UIKit 0x0000000102ce3d0c -[UIViewController setValue:forKey:] + 88
5 UIKit 0x0000000102f1a7fb -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000102262890 -[NSArray makeObjectsPerformSelector:] + 224
7 UIKit 0x0000000102f191de -[UINib instantiateWithOwner:options:] + 1864
8 UIKit 0x0000000102cea8d6 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
9 UIKit 0x0000000102ceb202 -[UIViewController loadView] + 178
10 UIKit 0x0000000102ceb560 -[UIViewController loadViewIfRequired] + 138
11 UIKit 0x0000000102cebcd3 -[UIViewController view] + 27
12 UIKit 0x0000000102bc1fb4 -[UIWindow addRootViewControllerViewIfPossible] + 61
13 UIKit 0x0000000102bc269d -[UIWindow _setHidden:forced:] + 282
14 UIKit 0x0000000102bd4180 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x0000000102b48ed9 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
16 UIKit 0x0000000102b4f568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1769
17 UIKit 0x0000000102b4c714 -[UIApplication workspaceDidEndTransaction:] + 188
18 FrontBoardServices 0x0000000105f5d8c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
19 FrontBoardServices 0x0000000105f5d741 -[FBSSerialQueue _performNext] + 178
20 FrontBoardServices 0x0000000105f5daca -[FBSSerialQueue _performNextFromRunLoopSource] + 45
21 CoreFoundation 0x000000010224e301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x000000010224422c __CFRunLoopDoSources0 + 556
23 CoreFoundation 0x00000001022436e3 __CFRunLoopRun + 867
24 CoreFoundation 0x00000001022430f8 CFRunLoopRunSpecific + 488
25 UIKit 0x0000000102b4bf21 -[UIApplication _run] + 402
26 UIKit 0x0000000102b50f09 UIApplicationMain + 171
27 numChsnger 0x0000000102144382 main + 114
28 libdyld.dylib 0x0000000104b9092d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
View:
Check if your stepper has a redundant outlet in your storyboard. Right click on the stepper object in Storyboard and check if there is any outlet you don't want.
Also. Remove #Iboutlet var textV:UILabel! or reconnect it with the Label in your storyboard and the error will be gone.
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
When I run my app, it produces the Thread 1: signal SIGBART error message with the detail below:
TappingGame[767:9324] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x7fe5d0f12130> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tapButton.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010b07ee65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010aaf7deb objc_exception_throw + 48
2 CoreFoundation 0x000000010b07eaa9 -[NSException raise] + 9
3 Foundation 0x000000010a6c49bb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
4 UIKit 0x000000010b5ba320 -[UIViewController setValue:forKey:] + 88
5 UIKit 0x000000010b7e8f41 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010afbf4a0 -[NSArray makeObjectsPerformSelector:] + 224
7 UIKit 0x000000010b7e7924 -[UINib instantiateWithOwner:options:] + 1864
8 UIKit 0x000000010b5c0eea -[UIViewController _loadViewFromNibNamed:bundle:] + 381
9 UIKit 0x000000010b5c1816 -[UIViewController loadView] + 178
10 UIKit 0x000000010b5c1b74 -[UIViewController loadViewIfRequired] + 138
11 UIKit 0x000000010b5c22e7 -[UIViewController view] + 27
12 UIKit 0x000000010b498ab0 -[UIWindow addRootViewControllerViewIfPossible] + 61
13 UIKit 0x000000010b499199 -[UIWindow _setHidden:forced:] + 282
14 UIKit 0x000000010b4aac2e -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x000000010b423663 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
16 UIKit 0x000000010b429cc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
17 UIKit 0x000000010b426e7b -[UIApplication workspaceDidEndTransaction:] + 188
18 FrontBoardServices 0x000000010ddf7754 -[FBSSerialQueue _performNext] + 192
19 FrontBoardServices 0x000000010ddf7ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
20 CoreFoundation 0x000000010afaaa31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
21 CoreFoundation 0x000000010afa095c __CFRunLoopDoSources0 + 556
22 CoreFoundation 0x000000010af9fe13 __CFRunLoopRun + 867
23 CoreFoundation 0x000000010af9f828 CFRunLoopRunSpecific + 488
24 UIKit 0x000000010b4267cd -[UIApplication _run] + 402
25 UIKit 0x000000010b42b610 UIApplicationMain + 171
26 TappingGame 0x000000010a5f89ef main + 111
27 libdyld.dylib 0x000000010d7ba92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
I have looked at other questions asked but none of these solutions work. Does anyone have any idea from the errors listed as to why it isn't working?
Thanks
The problem described in your error is due to a incorrect linked class in your storyboard or nib.
You have an incorrect link. Probably you delete or changed name.
Check if your IBOutlet are correct link as image:
and remove invalid links.
I am new to coding and Xcode. The problem I am facing with is stated in the title. I hope anyone can help me out of it.
The error message will be pasted at below
2015-07-13 01:11:36.443 Main_Iphone 6[2570:94488] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Main_Iphone_6.ViewController 0x7fccc8432560> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Button.'
First throw call stack:
(
0 CoreFoundation 0x0000000100c02c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010276dbb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000100c028a9 -[NSException raise] + 9
3 Foundation 0x0000000101020b53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000100b4ad50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x00000001017794eb -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x00000001015d16d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
7 UIKit 0x00000001015d1cc8 -[UIViewController loadView] + 109
8 UIKit 0x00000001015d1f39 -[UIViewController loadViewIfRequired] + 75
9 UIKit 0x00000001015d23ce -[UIViewController view] + 27
10 UIKit 0x00000001014ed289 -[UIWindow addRootViewControllerViewIfPossible] + 58
11 UIKit 0x00000001014ed64f -[UIWindow _setHidden:forced:] + 247
12 UIKit 0x00000001014f9de1 -[UIWindow makeKeyAndVisible] + 42
13 UIKit 0x000000010149d417 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2732
14 UIKit 0x00000001014a019e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1349
15 UIKit 0x000000010149f095 -[UIApplication workspaceDidEndTransaction:] + 179
16 FrontBoardServices 0x000000010426a5e5 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 21
17 CoreFoundation 0x0000000100b3641c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
18 CoreFoundation 0x0000000100b2c165 __CFRunLoopDoBlocks + 341
19 CoreFoundation 0x0000000100b2bf25 __CFRunLoopRun + 2389
20 CoreFoundation 0x0000000100b2b366 CFRunLoopRunSpecific + 470
21 UIKit 0x000000010149eb02 -[UIApplication _run] + 413
22 UIKit 0x00000001014a18c0 UIApplicationMain + 1282
23 Main_Iphone 6 0x0000000100a101d7 main + 135
24 libdyld.dylib 0x0000000102ea3145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
You've got an outlet called Button defined in a storyboard or xib file, but the thing you're connecting it to doesn't have a property of the same name. Either you've deleted an IBOutlet from code or you've not set the correct view controller class in the identity inspector in interface builder.
The most important information is this class is not key value coding-compliant for the key Button.
From the backtrace you can see, that after an UINib is instantiated
[UINib instantiateWithOwner:options:]
there is a method sent to all objects of an array
[NSArray makeObjectsPerformSelector:]
to set the value of a property Button
[NSObject(NSKeyValueCoding) setValue:forKey:]
This property must be synthesized or have explicit setter and getter to be key value coding-compliant.
Set an Exception Breakpoint to find the exact location of the crash and look into your model classes for a missing property Button