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 5 years ago.
I am currently making an app and I am using Swft 3 with Xcode 8.2 beta. I am trying to make it so that the user is able to access the social media from the SWRevealViewController in my iOS project. When the social media buttons are clicked they should open up the corresponding app. However, when the code is executed and the iOS simulator is opened, when I slide to open up the SWRevealViewController(the menu), the app crashes.
Full Error message:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TheGunnOracleApp.SocialMedia 0x7ffd0d50c0d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dataSource.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010212dd4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000101b8f21e objc_exception_throw + 48
2 CoreFoundation 0x000000010212dc99 -[NSException raise] + 9
3 Foundation 0x000000010169db3f -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x0000000102e8e99f -[UIViewController setValue:forKey:] + 88
5 UIKit 0x0000000103102c6e -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x00000001020d2b60 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x00000001031015f2 -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x0000000102e950d1 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x0000000102e959f3 -[UIViewController loadView] + 177
10 UIKit 0x000000010311561c -[UITableViewController loadView] + 84
11 UIKit 0x0000000102e95d28 -[UIViewController loadViewIfRequired] + 201
12 UIKit 0x0000000102e9657c -[UIViewController view] + 27
13 TheGunnOracleApp 0x00000001014d50fb -[SWRevealViewController _deployForViewController:inView:] + 235
14 TheGunnOracleApp 0x00000001014d4f58 -[SWRevealViewController _deploymentForViewController:inView:appear:disappear:] + 136
15 TheGunnOracleApp 0x00000001014d48c1 -[SWRevealViewController _rearViewDeploymentForNewFrontViewPosition:] + 433
16 TheGunnOracleApp 0x00000001014d32f2 -[SWRevealViewController _setFrontViewPosition:withDuration:] + 82
17 TheGunnOracleApp 0x00000001014d26c6 __65-[SWRevealViewController _dispatchSetFrontViewPosition:animated:]_block_invoke + 70
18 TheGunnOracleApp 0x00000001014d1300 -[SWRevealViewController _enqueueBlock:] + 160
19 TheGunnOracleApp 0x00000001014d261b -[SWRevealViewController _dispatchSetFrontViewPosition:animated:] + 251
20 TheGunnOracleApp 0x00000001014d0154 -[SWRevealViewController setFrontViewPosition:animated:] + 148
21 TheGunnOracleApp 0x00000001014cffed -[SWRevealViewController revealToggleAnimated:] + 93
22 TheGunnOracleApp 0x00000001014d05df -[SWRevealViewController revealToggle:] + 63
23 UIKit 0x0000000102cf645c -[UIApplication sendAction:to:from:forEvent:] + 83
24 UIKit 0x0000000103137971 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 149
25 UIKit 0x0000000102cf645c -[UIApplication sendAction:to:from:forEvent:] + 83
26 UIKit 0x0000000102e7c344 -[UIControl sendAction:to:forEvent:] + 67
27 UIKit 0x0000000102e7c65d -[UIControl _sendActionsForEvents:withEvent:] + 444
28 UIKit 0x0000000102e7c7e7 -[UIControl _sendActionsForEvents:withEvent:] + 838
29 UIKit 0x0000000102e7b559 -[UIControl touchesEnded:withEvent:] + 668
30 UIKit 0x0000000102d63d5d -[UIWindow _sendTouchesForEvent:] + 2747
31 UIKit 0x0000000102d6544b -[UIWindow sendEvent:] + 4011
32 UIKit 0x0000000102d1254b -[UIApplication sendEvent:] + 371
33 UIKit 0x00000001034fda0f __dispatchPreprocessedEventFromEventQueue + 3248
34 UIKit 0x00000001034f6745 __handleEventQueue + 4879
35 CoreFoundation 0x00000001020d28e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
36 CoreFoundation 0x00000001020b7b0c __CFRunLoopDoSources0 + 556
37 CoreFoundation 0x00000001020b6ff6 __CFRunLoopRun + 918
38 CoreFoundation 0x00000001020b6a04 CFRunLoopRunSpecific + 420
39 GraphicsServices 0x0000000107e37a6f GSEventRunModal + 161
40 UIKit 0x0000000102cf4808 UIApplicationMain + 159
41 TheGunnOracleApp 0x00000001014f2d0f main + 111
42 libdyld.dylib 0x0000000105ddd68d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is the code for each button in the social media.
Note: I removed code for the rest of the social media because of Facebook not working at first:
import Foundation
import UIKit
class SocialMedia: UITableViewController{
#IBAction func facebookOpen(_ sender: Any) {
UIApplication.shared.open(NSURL(string: "https://www.facebook.com/gunnoracle")! as URL)
}
}
Here is a screenshot of what my Main.storyboard UITableViewController looks like:
Seems that the problem is not caused by that very line of code as I just tried it and it worked.
when I slide to open up the SWRevealViewController(the menu), the app crashes.
This is might be the cause. Something wrong with how you use SWRevealViewController.
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 4 years ago.
as mentioned above, during one of the courses I am taking, when I run my project, the simulator opens the app, which appears to be blank.
I already reviewed many posts from people who had the same problem of mine and I tried unsuccessfully their solutions.
The solutions I reviewed are:
- Erase all content of the simulator
- Changed the type of simulator (from iPhone 8 plus to iPhone 7 plus)
- Making sure I had the right settings on the Info.plist
- Build different times the program from scratch as a new one.
And probably others I don't even remember.
I attach my files, as well as the page that opens right when my Simulator launches the application. ( the last screenshot )
Here is the error log
2018-06-18 22:52:29.685489+0200 Bullseye[2247:47563] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Bullseye.ViewController 0x7fc0df70bf90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key numValue.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010625e1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x0000000102665031 objc_exception_throw + 48
2 CoreFoundation 0x000000010625e0b9 -[NSException raise] + 9
3 Foundation 0x0000000102086b47 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x000000010309cec0 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x000000010338ae8a -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000106200e8d -[NSArray makeObjectsPerformSelector:] + 317
7 UIKit 0x0000000103389834 -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x00000001030a40d7 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
9 UIKit 0x00000001030a4a04 -[UIViewController loadView] + 177
10 UIKit 0x00000001030a4d21 -[UIViewController loadViewIfRequired] + 175
11 UIKit 0x00000001030a5574 -[UIViewController view] + 27
12 UIKit 0x0000000102f73123 -[UIWindow addRootViewControllerViewIfPossible] + 122
13 UIKit 0x0000000102f73834 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x0000000102f865cc -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x0000000102efa3da -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4739
16 UIKit 0x0000000102eff5cb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
17 UIKit 0x00000001032c1f7e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
18 UIKit 0x0000000103694a39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
19 UIKit 0x00000001032c1bba -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
20 UIKit 0x00000001032c23db -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
21 UIKit 0x0000000103c33614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
22 UIKit 0x0000000103c334ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
23 UIKit 0x000000010391775d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
24 UIKit 0x0000000103b124b7 _performActionsWithDelayForTransitionContext + 100
25 UIKit 0x0000000103917627 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
26 UIKit 0x00000001036940e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
27 UIKit 0x0000000102efdeac -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
28 UIKit 0x00000001034d0bcb -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
29 FrontBoardServices 0x000000010828d2f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
30 FrontBoardServices 0x0000000108295cfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
31 libdispatch.dylib 0x00000001073c27ec _dispatch_client_callout + 8
32 libdispatch.dylib 0x00000001073c7db8 _dispatch_block_invoke_direct + 592
33 FrontBoardServices 0x00000001082c1470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
34 FrontBoardServices 0x00000001082c112e -[FBSSerialQueue _performNext] + 439
35 FrontBoardServices 0x00000001082c168e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
36 CoreFoundation 0x0000000106200bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
37 CoreFoundation 0x00000001061e54af __CFRunLoopDoSources0 + 271
38 CoreFoundation 0x00000001061e4a6f __CFRunLoopRun + 1263
39 CoreFoundation 0x00000001061e430b CFRunLoopRunSpecific + 635
40 GraphicsServices 0x0000000108b56a73 GSEventRunModal + 62
41 UIKit 0x0000000102f01057 UIApplicationMain + 159
42 Bullseye 0x0000000101d5bad7 main + 55
43 libdyld.dylib 0x000000010743f955 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
This might be because you have a bad connection in your outlets. Review them. If you have them changed in the view controller, you still need to update them in the storyboard.
the simulator is blank because your app is crashing. Check your storyboard outlet connections to make ensure they are all connected. Open the connections inspector and look out for any broken connections. If your connections are right the circles in your view controller should be filled (see image below)
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 5 years ago.
I'm currently working myself through this tutorial:
https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ConnectTheUIToCode.html#//apple_ref/doc/uid/TP40015214-CH22-SW1
After creating the function for the button(at ~2/3 on the page) I tried running the code and got the Exception:
2017-12-08 11:24:31.343183+0100 FoodTracker[2159:154603] ***
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FoodTracker.ViewController 0x7fea6f406820> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key setDefaultLabelText.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109d7512b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001060fcf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000109d75079 -[NSException raise] + 9
3 Foundation 0x0000000105b1ba63 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x0000000106b39117 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x0000000106e2ac2d -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x0000000109d183cd -[NSArray makeObjectsPerformSelector:] + 317
7 UIKit 0x0000000106e295e3 -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x0000000106b403ff -[UIViewController _loadViewFromNibNamed:bundle:] + 383
9 UIKit 0x0000000106b40d2b -[UIViewController loadView] + 177
10 UIKit 0x0000000106b4105c -[UIViewController loadViewIfRequired] + 195
11 UIKit 0x0000000106b418b9 -[UIViewController view] + 27
12 UIKit 0x0000000106a0c7cf -[UIWindow addRootViewControllerViewIfPossible] + 122
13 UIKit 0x0000000106a0ced7 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x0000000106a1fe54 -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x00000001069928b8 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4737
16 UIKit 0x0000000106997aeb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
17 UIKit 0x0000000106d616f8 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
18 UIKit 0x00000001071374c8 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
19 UIKit 0x0000000106d612f1 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
20 UIKit 0x0000000106d61b6b -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 696
21 UIKit 0x00000001076dfa69 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
22 UIKit 0x00000001076df922 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
23 UIKit 0x00000001073bc9c8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
24 UIKit 0x00000001075bbb06 _performActionsWithDelayForTransitionContext + 100
25 UIKit 0x00000001073bc88b -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
26 UIKit 0x0000000107136b25 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
27 UIKit 0x000000010699636a -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
28 UIKit 0x0000000106f71605 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
29 FrontBoardServices 0x000000010bc38cc0 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
30 FrontBoardServices 0x000000010bc417b5 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
31 libdispatch.dylib 0x000000010ae9733d _dispatch_client_callout + 8
32 libdispatch.dylib 0x000000010ae9c9f3 _dispatch_block_invoke_direct + 592
33 FrontBoardServices 0x000000010bc6d498 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
34 FrontBoardServices 0x000000010bc6d14e -[FBSSerialQueue _performNext] + 464
35 FrontBoardServices 0x000000010bc6d6bd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
36 CoreFoundation 0x0000000109d18101 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
37 CoreFoundation 0x0000000109db7f71 __CFRunLoopDoSource0 + 81
38 CoreFoundation 0x0000000109cfca19 __CFRunLoopDoSources0 + 185
39 CoreFoundation 0x0000000109cfbfff __CFRunLoopRun + 1279
40 CoreFoundation 0x0000000109cfb889 CFRunLoopRunSpecific + 409
41 GraphicsServices 0x000000010c5019c6 GSEventRunModal + 62
42 UIKit 0x00000001069995d6 UIApplicationMain + 159
43 FoodTracker 0x00000001057e7b67 main + 55
44 libdyld.dylib 0x000000010af13d81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is my Code:
And the connections inspector of the button:
This is due to FoodTracker VC in storyboard has an outlet created but not connected.
How to resolve the issue? Follow these steps.
Open your storyboard, click on view controller below view controller scene.
Check for all outlets for ViewController.
Remove those outlets created and are not connected to ViewController.swift implementation file.
Keep me updated on the same.
Check your connection to #IBAction with this steps below:
In the storyboard:
In your view controller:
Updated:
In your case, you should remove connection in Reference Outlets because you connect it to the label outlet.
Hi my app shows no errors, but when I run my app it freezes and shows the THREAD 1 SIGNAL SIGABRT, on the line beginning with 'return'. I am using Xcode 5. Also if I update Xcode to Xcode 6 will this fix the errors?
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
The debugger shows:
2014-10-18 09:43:14.726 2 Player Pong[448:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Game 0x8d24a50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ButtonMove.'
*** First throw call stack:
(
0 CoreFoundation 0x017ef1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0156e8e5 objc_exception_throw + 44
2 CoreFoundation 0x0187efe1 -[NSException raise] + 17
3 Foundation 0x0122ed9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x0119b1d7 _NSSetUsingKeyValueSetter + 88
5 Foundation 0x0119a731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x011fcb0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x004e51f4 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x015807de -[NSObject performSelector:] + 62
9 CoreFoundation 0x017ea76a -[NSArray makeObjectsPerformSelector:] + 314
10 UIKit 0x004e3d4d -[UINib instantiateWithOwner:options:] + 1417
11 UIKit 0x0034c6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
12 UIKit 0x0034ce9d -[UIViewController loadView] + 302
13 UIKit 0x0034d0d3 -[UIViewController loadViewIfRequired] + 78
14 UIKit 0x0034d5d9 -[UIViewController view] + 35
15 UIKit 0x0035cf89 -[UIViewController shouldAutorotate] + 36
16 UIKit 0x0035d2d1 -[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:] + 297
17 UIKit 0x005fb3d5 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:] + 2330
18 UIKit 0x003595d5 -[UIViewController presentViewController:withTransition:completion:] + 6538
19 UIKit 0x00359aef -[UIViewController presentViewController:animated:completion:] + 130
20 UIKit 0x00359b2f -[UIViewController presentModalViewController:animated:] + 56
21 UIKit 0x007a3e00 -[UIStoryboardModalSegue perform] + 271
22 UIKit 0x00792f0c -[UIStoryboardSegueTemplate _perform:] + 174
23 UIKit 0x00792f87 -[UIStoryboardSegueTemplate perform:] + 115
24 libobjc.A.dylib 0x01580880 -[NSObject performSelector:withObject:withObject:] + 77
25 UIKit 0x002303b9 -[UIApplication sendAction:to:from:forEvent:] + 108
26 UIKit 0x00230345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
27 UIKit 0x00331bd1 -[UIControl sendAction:to:forEvent:] + 66
28 UIKit 0x00331fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
29 UIKit 0x00331243 -[UIControl touchesEnded:withEvent:] + 641
30 UIKit 0x0026fddd -[UIWindow _sendTouchesForEvent:] + 852
31 UIKit 0x002709d1 -[UIWindow sendEvent:] + 1117
32 UIKit 0x002425f2 -[UIApplication sendEvent:] + 242
33 UIKit 0x0022c353 _UIApplicationHandleEventQueue + 11455
34 CoreFoundation 0x0177877f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
35 CoreFoundation 0x0177810b __CFRunLoopDoSources0 + 235
36 CoreFoundation 0x017951ae __CFRunLoopRun + 910
37 CoreFoundation 0x017949d3 CFRunLoopRunSpecific + 467
38 CoreFoundation 0x017947eb CFRunLoopRunInMode + 123
39 GraphicsServices 0x037e35ee GSEventRunModal + 192
40 GraphicsServices 0x037e342b GSEventRun + 104
41 UIKit 0x0022ef9b UIApplicationMain + 1225
42 2 Player Pong 0x0000317d main + 141
43 libdyld.dylib 0x01e36701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
u have not assigned the key in your VC the key name is ButtonMove , go to your attribute inspector remove the invalid key ButtonMove finally clean and run the project
It may be firstly, an outlet referenced to a control which has been removed, secondly, check any wrong Key/value in attribute inspector
This question already has an answer here:
Loaded the nib but didn't get a UITableView Exception
(1 answer)
Closed 8 years ago.
Today I ran my code that hasn't had any errors until now. Whenever someone clicks on the middle tab at the bottom the app crashes completely but all the other tabs work fine. Here's the call stack:
2014-07-01 16:27:19.848 Test Web[66180:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "lwz-qR-aDm-view-tp0-bK-7dP" nib but didn't get a UITableView.'
*** First throw call stack:
(
0 CoreFoundation 0x017f11e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015708e5 objc_exception_throw + 44
2 CoreFoundation 0x017f0fbb +[NSException raise:format:] + 139
3 UIKit 0x0050418e -[UITableViewController loadView] + 281
4 UIKit 0x0034f0d3 -[UIViewController loadViewIfRequired] + 78
5 UIKit 0x0034f5d9 -[UIViewController view] + 35
6 UIKit 0x0038711f -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 407
7 UIKit 0x00386943 -[UITabBarController transitionFromViewController:toViewController:] + 63
8 UIKit 0x00382bed -[UITabBarController _setSelectedViewController:] + 281
9 UIKit 0x00382acc -[UITabBarController setSelectedViewController:] + 180
10 UIKit 0x0038683f -[UITabBarController _tabBarItemClicked:] + 312
11 libobjc.A.dylib 0x01582880 -[NSObject performSelector:withObject:withObject:] + 77
12 UIKit 0x002323b9 -[UIApplication sendAction:to:from:forEvent:] + 108
13 UIKit 0x00232345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
14 UIKit 0x004f6629 -[UITabBar _sendAction:withEvent:] + 479
15 libobjc.A.dylib 0x0158282b -[NSObject performSelector:withObject:] + 70
16 UIKit 0x002323b9 -[UIApplication sendAction:to:from:forEvent:] + 108
17 UIKit 0x00232345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
18 UIKit 0x00333bd1 -[UIControl sendAction:to:forEvent:] + 66
19 UIKit 0x00333fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
20 UIKit 0x00333c06 -[UIControl sendActionsForControlEvents:] + 48
21 UIKit 0x004fb23d -[UITabBar(Static) _buttonUp:] + 123
22 libobjc.A.dylib 0x01582880 -[NSObject performSelector:withObject:withObject:] + 77
23 UIKit 0x002323b9 -[UIApplication sendAction:to:from:forEvent:] + 108
24 UIKit 0x00232345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
25 UIKit 0x00333bd1 -[UIControl sendAction:to:forEvent:] + 66
26 UIKit 0x00333fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
27 UIKit 0x00333243 -[UIControl touchesEnded:withEvent:] + 641
28 UIKit 0x00271ddd -[UIWindow _sendTouchesForEvent:] + 852
29 UIKit 0x002729d1 -[UIWindow sendEvent:] + 1117
30 UIKit 0x002445f2 -[UIApplication sendEvent:] + 242
31 UIKit 0x0022e353 _UIApplicationHandleEventQueue + 11455
32 CoreFoundation 0x0177a77f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
33 CoreFoundation 0x0177a10b __CFRunLoopDoSources0 + 235
34 CoreFoundation 0x017971ae __CFRunLoopRun + 910
35 CoreFoundation 0x017969d3 CFRunLoopRunSpecific + 467
36 CoreFoundation 0x017967eb CFRunLoopRunInMode + 123
37 GraphicsServices 0x037e55ee GSEventRunModal + 192
38 GraphicsServices 0x037e542b GSEventRun + 104
39 UIKit 0x00230f9b UIApplicationMain + 1225
40 Test Web 0x000031fd main + 141
41 libdyld.dylib 0x01e38701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I've tried looking for a solution to this error and checking back over the storyboard but found nothing out of place. Any ideas on a fix?
UITableViewController needs an UITableView connected to it's view property.
Also make sure that the delegate and datasource are properly connected.
If you use xib, make sure that UITableView connected to fileOwner.tableView property.
You probably use xib file to make interface.
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.
I've began to program an iOS application, but I ran into a sudden problem. The program worked as intended, I had a single view application, with navigation bar with title Title. When I compiled it, it was okay, but then I decided to "retitle" the title bar to say Hello. And after that I've got an error without a slightest idea what for, cause it worked like a minute before this error and the only change was the title of the title bar.
here is the error
Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
[<MapViewController 0xa964410> setValue:forUndefinedKey:]: this class is not key
value coding-compliant for the key titleText.'
*** First throw call stack:
(
0 CoreFoundation 0x027a51e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x025248e5 objc_exception_throw + 44
2 CoreFoundation 0x02834fe1 -[NSException raise] + 17
3 Foundation 0x021e4d9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x021511d7 _NSSetUsingKeyValueSetter + 88
5 Foundation 0x02150731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x021b2b0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x0149b1f4 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x025367de -[NSObject performSelector:] + 62
9 CoreFoundation 0x027a076a -[NSArray makeObjectsPerformSelector:] + 314
10 UIKit 0x01499d4d -[UINib instantiateWithOwner:options:] + 1417
11 UIKit 0x013026f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
12 UIKit 0x01302e9d -[UIViewController loadView] + 302
13 UIKit 0x013030d3 -[UIViewController loadViewIfRequired] + 78
14 UIKit 0x013035d9 -[UIViewController view] + 35
15 UIKit 0x01223267 -[UIWindow addRootViewControllerViewIfPossible] + 66
16 UIKit 0x012235ef -[UIWindow _setHidden:forced:] + 312
17 UIKit 0x0122386b -[UIWindow _orderFrontWithoutMakingKey] + 49
18 UIKit 0x0122e3c8 -[UIWindow makeKeyAndVisible] + 65
19 Anchor-It 0x00005a39 -[AppDelegate application:didFinishLaunchingWithOptions:] + 585
20 UIKit 0x011de14f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
21 UIKit 0x011deaa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810
22 UIKit 0x011e3667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
23 UIKit 0x011f7f92 -[UIApplication handleEvent:withNewEvent:] + 3517
24 UIKit 0x011f8555 -[UIApplication sendEvent:] + 85
25 UIKit 0x011e5250 _UIApplicationHandleEvent + 683
26 GraphicsServices 0x0381df02 _PurpleEventCallback + 776
27 GraphicsServices 0x0381da0d PurpleEventCallback + 46
28 CoreFoundation 0x02720ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
29 CoreFoundation 0x027209db __CFRunLoopDoSource1 + 523
30 CoreFoundation 0x0274b68c __CFRunLoopRun + 2156
31 CoreFoundation 0x0274a9d3 CFRunLoopRunSpecific + 467
32 CoreFoundation 0x0274a7eb CFRunLoopRunInMode + 123
33 UIKit 0x011e2d9c -[UIApplication _run] + 840
34 UIKit 0x011e4f9b UIApplicationMain + 1225
35 Anchor-It 0x00005dbd main + 141
36 libdyld.dylib 0x03f5e701 start + 1
37 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Look at this part of the stack trace:
3 Foundation 0x021e4d9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x021511d7 _NSSetUsingKeyValueSetter + 88
5 Foundation 0x02150731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x021b2b0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x0149b1f4 -[UIRuntimeOutletConnection connect] + 106
You've got a bad connection in your .xib or storyboard file. The view loading process is trying to connect something to some outlet that doesn't exist, resulting in an exception being thrown. Further information about exactly what connection is bad comes from the exception itself:
[<MapViewController 0xa964410> setValue:forUndefinedKey:]: this class is not key
value coding-compliant for the key titleText.'
So, you've got an instance of MapViewController, and UIRuntimeOutletConnection (part of the view loading system) is trying to set an outlet called titleText. MapViewController apparently doesn't have a titleText property. This could happen because you used to have such a property but deleted it, or because you changed the class of the view controller from something else (that had such a property) to MapViewController (which doesn't), etc.