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
Related
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 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.
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...
Hi I am making an app and want to use a button to switch from one view controller to another view controller. I used a modal segue and made a UIbutton action calling performSegueWithIdentifier. However, I got
Terminating with uncaught exception of type NSException
error in AppleDelegate file. I have no idea what's going on here. PLease help me! THanks a lot.
Here is what the program explains:
2015-11-20 01:22:21.575 Photo book[17126:547637] Unknown class ViewController1 in Interface Builder file.
2015-11-20 01:22:21.581 Photo book[17126:547637] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7f9698e1d2b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Open.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103d7fc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000103a18bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000103d7f8a9 -[NSException raise] + 9
3 Foundation 0x00000001035aeb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000103cc7d50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010469252b -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x00000001048f4aba -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
7 UIKit 0x00000001048f80bf -[UIStoryboardSegueTemplate _perform:] + 71
8 UIKit 0x0000000111251638 -[UIViewControllerAccessibility performSegueWithIdentifier:sender:] + 39
9 Photo book 0x0000000103479c66 _TFC10Photo_book14ViewController5LoginfS0_FCSo8UIButtonT_ + 278
10 Photo book 0x0000000103479cea _TToFC10Photo_book14ViewController5LoginfS0_FCSo8UIButtonT_ + 58
11 UIKit 0x00000001043bbda2 -[UIApplication sendAction:to:from:forEvent:] + 75
12 UIKit 0x00000001044cd54a -[UIControl _sendActionsForEvents:withEvent:] + 467
13 UIKit 0x00000001044cc919 -[UIControl touchesEnded:withEvent:] + 522
14 UIKit 0x0000000104408998 -[UIWindow _sendTouchesForEvent:] + 735
15 UIKit 0x00000001044092c2 -[UIWindow sendEvent:] + 682
16 UIKit 0x00000001043cf581 -[UIApplication sendEvent:] + 246
17 UIKit 0x00000001043dcd1c _UIApplicationHandleEventFromQueueEvent + 18265
18 UIKit 0x00000001043b75dc _UIApplicationHandleEventQueue + 2066
19 CoreFoundation 0x0000000103cb3431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
20 CoreFoundation 0x0000000103ca92fd __CFRunLoopDoSources0 + 269
21 CoreFoundation 0x0000000103ca8934 __CFRunLoopRun + 868
22 CoreFoundation 0x0000000103ca8366 CFRunLoopRunSpecific + 470
23 GraphicsServices 0x00000001085cda3e GSEventRunModal + 161
24 UIKit 0x00000001043ba900 UIApplicationMain + 1282
25 Photo book 0x000000010348b1c7 main + 135
26 libdyld.dylib 0x0000000106965145 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
this error occurs when you accidently delete iboutlet from your .h file but they are still connected in your xib or storyboard.. make sure that all your iboutlets are connected properly in your second view.
First set you class name as following
Then set segue identifier
And check weather if you have deleted any IBOutlet accidentally or you have change name of controls programatically then respective outlet not found.
I'm developing a simple app and when I click to sign up the user, the app gets terminated. Please help me figure this out.
It says that:
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[
setValue:forUndefinedKey:]: this class is not key value
coding-compliant for the key CreditCardTextField.'
Here's the error in more detail:
015-06-04 22:42:57.661 ParseStarterProject[43853:4461316] Unknown
class RegisterPageViewController in Interface Builder file. 2015-06-04
22:42:57.712 ParseStarterProject[43853:4461316] * Terminating app
due to uncaught exception 'NSUnknownKeyException', reason:
'[ setValue:forUndefinedKey:]: this
class is not key value coding-compliant for the key
CreditCardTextField.'
* First throw call stack: ( 0 CoreFoundation 0x00000001106ccf35 exceptionPreprocess + 165 1 libobjc.A.dylib
0x000000011233ebb7 objc_exception_throw + 45 2 CoreFoundation
0x00000001106ccb79 -[NSException raise] + 9 3 Foundation
0x0000000110b6b7b3 -[NSObject(NSKeyValueCoding) setValue:forKey:] +
259 4 CoreFoundation 0x0000000110616e80
-[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x000000011134bc7d -[UINib instantiateWithOwner:options:] + 1506 6
UIKit 0x00000001111aaf98
-[UIViewController _loadViewFromNibNamed:bundle:] + 242 7 UIKit 0x00000001111ab588 -[UIViewController loadView] + 109 8 UIKit
0x00000001111ab7f9 -[UIViewController loadViewIfRequired] + 75 9
UIKit 0x00000001111abc8e
-[UIViewController view] + 27 10 UIKit 0x000000011174d41e -[_UIFullscreenPresentationController
_setPresentedViewController:] + 65 11 UIKit 0x0000000111187429 -[UIPresentationController
initWithPresentedViewController:presentingViewController:] + 105 12
UIKit 0x00000001111b7a41
-[UIViewController _presentViewController:withAnimationController:completion:] + 1746 13 UIKit 0x00000001111b9d81
__62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132 14
UIKit 0x00000001111b9ca5
-[UIViewController presentViewController:animated:completion:] + 229 15 UIKit 0x00000001110878be
-[UIApplication sendAction:to:from:forEvent:] + 75 16 UIKit 0x000000011118e410 -[UIControl _sendActionsForEvents:withEvent:] + 467
17 UIKit 0x000000011118d7df
-[UIControl touchesEnded:withEvent:] + 522 18 UIKit 0x00000001110cd308 -[UIWindow _sendTouchesForEvent:] + 735 19 UIKit
0x00000001110cdc33 -[UIWindow sendEvent:] + 683 20 UIKit
0x000000011109a9b1 -[UIApplication sendEvent:] + 246 21 UIKit
0x00000001110a7a7d _UIApplicationHandleEventFromQueueEvent + 17370 22
UIKit 0x0000000111083103
_UIApplicationHandleEventQueue + 1961 23 CoreFoundation 0x0000000110602551
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 24 CoreFoundation 0x00000001105f841d
__CFRunLoopDoSources0 + 269 25 CoreFoundation 0x00000001105f7a54 __CFRunLoopRun + 868 26 CoreFoundation
0x00000001105f7486 CFRunLoopRunSpecific + 470 27 GraphicsServices
0x0000000113de79f0 GSEventRunModal + 161 28 UIKit
0x0000000111086420 UIApplicationMain + 1282 29 ParseStarterProject
0x000000010fbbe9de top_level_code + 78 30 ParseStarterProject
0x000000010fbbeaba main + 42 31 libdyld.dylib
0x0000000112b54145 start + 1 32 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException (lldb)
It seems that you have a bronken #IBOutlet for CreditCardTextField, check in your storyboard, as soon as you reconnect the outlet it all should work again
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key CreditCardTextField.'
This is how you check your outlets:
Select the field, the outlets in the right should be connect correctly and the circles in the code should have a dot inside, if not the connection is broken, control drag to fix it.
NB. this can also happen in a Core Data app if the case of the property in the app code doesn't match a property in the momd. eg "launchPad" vs "launchpad"