can't delete This class is not key value coding-compliant for the key ptbLabel.' - swift

I have error like this.
This class is not key value coding-compliant for the key ptbLabel.
I know this error happens when there is something wrong with a linkage between storyboard and source code.
So, I deleted the linkage from storyboard.
then this error disappear.
However I reconnect again from Storyboard manually.
#IBOutlet weak var ptbLabel: UIImageView!
It shows the same error.
Why does this happen??
I guess it might be something related with project name change.
I have changed project name just a few steps before, by clicking the projectname at the top of left pain.
These are the error log below
] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7ff6e0404580> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key ptbLabel.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110901b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001102c5141 objc_exception_throw + 48
2 CoreFoundation 0x0000000110901a59 -[NSException raise] + 9
3 Foundation 0x000000010f6f1e8b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x000000010dfe0644 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x000000010e24d6b9 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x00000001108a7e8d -[NSArray makeObjectsPerformSelector:] + 269
7 UIKit 0x000000010e24c06f -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x000000010dfe6c73 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
9 UIKit 0x000000010dfe7589 -[UIViewController loadView] + 177
10 UIKit 0x000000010dfe78ba -[UIViewController loadViewIfRequired] + 195
11 UIKit 0x000000010dfe810a -[UIViewController view] + 27
12 UIKit 0x000000010deb063a -[UIWindow addRootViewControllerViewIfPossible] + 65
13 UIKit 0x000000010deb0d20 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x000000010dec3b6e -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x000000010de3d31f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346
16 UIKit 0x000000010de43584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
17 UIKit 0x000000010de40793 -[UIApplication workspaceDidEndTransaction:] + 182
18 FrontBoardServices 0x00000001149875f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
19 FrontBoardServices 0x000000011498746d -[FBSSerialQueue _performNext] + 186
20 FrontBoardServices 0x00000001149877f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
21 CoreFoundation 0x00000001108a7c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x000000011088d0cf __CFRunLoopDoSources0 + 527
23 CoreFoundation 0x000000011088c5ff __CFRunLoopRun + 911
24 CoreFoundation 0x000000011088c016 CFRunLoopRunSpecific + 406
25 UIKit 0x000000010de3f02f -[UIApplication _run] + 468
26 UIKit 0x000000010de450d4 UIApplicationMain + 159
27 BeatBrain 0x000000010be5dcb0 main + 48
28 libdyld.dylib 0x000000011198d65d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
-------- solution -------
I opened the storyboard as source code.
then found customModule is not changed when I changed the projectname.
<viewController id="2" customClass="viewController" customModule="OldProjectName" sceneMemberID="viewController">
I changed here OldProjectName -> NewProjectName
it works.
thanks very much.

Related

App crashes when table menu item selected in swift

The app crashes in simulator when one item is pressed on the slide out menu (created with table view), I've tried deleting connections between UI and IB and remaking them incase this is the issue, but it hasn't solved it.
This is the error code that comes out:
View Controller is : <AKSwiftSlideMenu.HomeVC: 0x7fa6c5e05b90>
Calculate your own repayment
2017-02-08 17:36:13.782 AKSwiftSlideMenu[37086:3161182] Unknown class TrackerVC in Interface Builder file.
2017-02-08 17:36:13.801 AKSwiftSlideMenu[37086:3161182] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fa6c5d1f920> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key AnnualInterestInput.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a9a0d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a40221e objc_exception_throw + 48
2 CoreFoundation 0x000000010a9a0c99 -[NSException raise] + 9
3 Foundation 0x0000000109f109df -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x000000010af5f293 -[UIViewController setValue:forKey:] + 88
5 UIKit 0x000000010b1d379e -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010a9459e0 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x000000010b1d2122 -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x000000010af659c5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x000000010af662e7 -[UIViewController loadView] + 177
10 UIKit 0x000000010af6661c -[UIViewController loadViewIfRequired] + 201
11 UIKit 0x000000010af6d062 -[UIViewController __viewWillAppear:] + 118
12 UIKit 0x000000010af981d3 -[UINavigationController _startCustomTransition:] + 1290
13 UIKit 0x000000010afa8e48 -[UINavigationController _startDeferredTransitionIfNeeded:] + 697
14 UIKit 0x000000010afa9fdb -[UINavigationController __viewWillLayoutSubviews] + 58
15 UIKit 0x000000010b1a0dd7 -[UILayoutContainerView layoutSubviews] + 223
16 UIKit 0x000000010ae89ab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
17 QuartzCore 0x000000010f85fbf8 -[CALayer layoutSublayers] + 146
18 QuartzCore 0x000000010f853440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
19 QuartzCore 0x000000010f8532be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
20 QuartzCore 0x000000010f7e1318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
21 QuartzCore 0x000000010f80e3ff _ZN2CA11Transaction6commitEv + 475
22 UIKit 0x000000010adef7f0 _afterCACommitHandler + 346
23 CoreFoundation 0x000000010a945267 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24 CoreFoundation 0x000000010a9451d7 __CFRunLoopDoObservers + 391
25 CoreFoundation 0x000000010a929f8e __CFRunLoopRun + 1198
26 CoreFoundation 0x000000010a929884 CFRunLoopRunSpecific + 420
27 GraphicsServices 0x000000010f02fa6f GSEventRunModal + 161
28 UIKit 0x000000010adc4c68 UIApplicationMain + 159
29 AKSwiftSlideMenu 0x0000000109e0401f main + 111
30 libdyld.dylib 0x000000010e09f68d start + 1
31 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
According to the error, it most probably is that one of your views is connected to an outlet named AnnualInterestInput that was deleted from the class.
If by deleting all the outlets and reconnecting them to the view controller didn't work it out, then it may be due to a wrong class in the xib.
This means that you have set a wrong class in the xib or storyboard and it's not able to found the key. If the class is still correct, check if the module is correct!
This line is what gives me a hint that this could be the problem:
2017-02-08 17:36:13.782 AKSwiftSlideMenu[37086:3161182] Unknown class TrackerVC in Interface Builder file.

SIGABRT Error swift

Could anyone help me understand why Im getting this error? It seems to be happening when I load one of my view controllers but I can't see why.
What usually causes an error like this?
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextInputTraits length]: unrecognized selector sent to instance 0x7fbf924828a0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010664ac65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105f27bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001066520ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001065a813c ___forwarding___ + 988
4 CoreFoundation 0x00000001065a7cd8 _CF_forwarding_prep_0 + 120
5 libswiftCore.dylib 0x0000000107ddf728 _TTSf4g_d___TFSSCfMSSFT12_cocoaStringPSs9AnyObject__SS + 120
6 libswiftCore.dylib 0x0000000107dc01a3 _TFSSCfMSSFT12_cocoaStringPSs9AnyObject__SS + 19
7 Project1 0x00000001054ec3bd _TToFC8ASA_Rank22SettingsViewControllers9ASANumberSS + 61
8 Foundation 0x0000000105abdb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
9 CoreFoundation 0x0000000106592d50 -[NSArray makeObjectsPerformSelector:] + 224
10 UIKit 0x0000000106d1b4eb -[UINib instantiateWithOwner:options:] + 1506
11 UIKit 0x0000000106b736d8 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
12 UIKit 0x0000000106b73cc8 -[UIViewController loadView] + 109
13 UIKit 0x0000000106b73f39 -[UIViewController loadViewIfRequired] + 75
14 UIKit 0x0000000106b743ce -[UIViewController view] + 27
15 UIKit 0x000000010710132d -[_UIFullscreenPresentationController _setPresentedViewController:] + 65
16 UIKit 0x0000000106b4ed69 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 105
17 UIKit 0x0000000106b80248 -[UIViewController _presentViewController:withAnimationController:completion:] + 1761
18 UIKit 0x0000000106b826c1 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132
19 UIKit 0x0000000106b825e5 -[UIViewController presentViewController:animated:completion:] + 229
20 UIKit 0x0000000106a44d62 -[UIApplication sendAction:to:from:forEvent:] + 75
21 UIKit 0x0000000106b5650a -[UIControl _sendActionsForEvents:withEvent:] + 467
22 UIKit 0x0000000106b558d9 -[UIControl touchesEnded:withEvent:] + 522
23 UIKit 0x0000000106a91958 -[UIWindow _sendTouchesForEvent:] + 735
24 UIKit 0x0000000106a92282 -[UIWindow sendEvent:] + 682
25 UIKit 0x0000000106a58541 -[UIApplication sendEvent:] + 246
26 UIKit 0x0000000106a65cdc _UIApplicationHandleEventFromQueueEvent + 18265
27 UIKit 0x0000000106a4059c _UIApplicationHandleEventQueue + 2066
28 CoreFoundation 0x000000010657e431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
29 CoreFoundation 0x00000001065742fd __CFRunLoopDoSources0 + 269
30 CoreFoundation 0x0000000106573934 __CFRunLoopRun + 868
31 CoreFoundation 0x0000000106573366 CFRunLoopRunSpecific + 470
32 GraphicsServices 0x000000010a1e0a3e GSEventRunModal + 161
33 UIKit 0x0000000106a438c0 UIApplicationMain + 1282
34 Project1 0x00000001054f70c7 main + 135
35 libdyld.dylib 0x0000000108530145 start + 1
36 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Please ask for any other informations that is helpful
Thanks
You most likely have an Outlet assigned to an element on the view controller you are transitioning to that is no longer connected to your code. This youtube video explains it in more detail.
To hunt down this issue, try right-clicking on all your elements (UILabels, UIViews, UIButton...) with the assistant editor open and cross check to see if the outlet name is referenced in the view controller.

Objective C: uncaught exception 'NSUnknownKeyException' [duplicate]

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 have this error "Thread 1: Program received signal: 'SIGABRT'" on this line...
[window addSubview:viewController.view];
what does it mean??
and here are the error messages:
2011-11-10 10:01:08.334 Paint Brush[1624:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Paint_BrushViewController 0x4b1b1d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key clear.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44
2 CoreFoundation 0x00dc24e1 -[NSException raise] + 17
3 Foundation 0x00794677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x007945e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0021030c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d388cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x0020ed23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x00210ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x000c6628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x000c4134 -[UIViewController loadView] + 120
11 UIKit 0x000c400e -[UIViewController view] + 56
12 Paint Brush 0x000024ae -[Paint_BrushAppDelegate application:didFinishLaunchingWithOptions:] + 94
13 UIKit 0x00014c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
14 UIKit 0x00016d88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
15 UIKit 0x00021617 -[UIApplication handleEvent:withNewEvent:] + 1533
16 UIKit 0x00019abf -[UIApplication sendEvent:] + 71
17 UIKit 0x0001ef2e _UIApplicationHandleEvent + 7576
18 GraphicsServices 0x00ffb992 PurpleEventCallback + 1550
19 CoreFoundation 0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
20 CoreFoundation 0x00d03cf7 __CFRunLoopDoSource1 + 215
21 CoreFoundation 0x00d00f83 __CFRunLoopRun + 979
22 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208
23 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97
24 UIKit 0x000167d2 -[UIApplication _run] + 623
25 UIKit 0x00022c93 UIApplicationMain + 1160
26 Paint Brush 0x00002419 main + 121
27 Paint Brush 0x00002395 start + 53
)
terminate called after throwing an instance of 'NSException'
In this class Paint_BrushAppDelegate, you might be setting a key where the key might not be a proper NSString. Please check the syntax or object you are passing as key. Please check if it is not nil.

facing exception after removing tab bar from app

I added UITabBarController in my app but removed after some time. App was working fine before adding UITabBarController but when I removed it from app, I started facing below exception.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<XpensesAppDelegate 0x4daaa40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tabBarController.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00fa45a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x010f8313 objc_exception_throw + 44
2 CoreFoundation 0x00fa44e1 -[NSException raise] + 17
3 Foundation 0x00035677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x000355e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004b930c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00f1a8cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004b7d23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004b9ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002bf17a -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002bfcf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
11 UIKit 0x002ca617 -[UIApplication handleEvent:withNewEvent:] + 1533
12 UIKit 0x002c2abf -[UIApplication sendEvent:] + 71
13 UIKit 0x002c7f2e _UIApplicationHandleEvent + 7576
14 GraphicsServices 0x018fc992 PurpleEventCallback + 1550
15 CoreFoundation 0x00f85944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x00ee5cf7 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x00ee2f83 __CFRunLoopRun + 979
18 CoreFoundation 0x00ee2840 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x00ee2761 CFRunLoopRunInMode + 97
20 UIKit 0x002bf7d2 -[UIApplication _run] + 623
21 UIKit 0x002cbc93 UIApplicationMain + 1160
22 Xpenses 0x00001ad9 main + 121
23 Xpenses 0x00001a55 start + 53
24 ??? 0x00000001 0x0 + 1
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Any solution to get rid of this exception?
You have something connected to the tabBarController outlet of your app delegate in Interface Builder. However the outlet no longer exists, so you're getting this error. You should just find and remove that connection.

Using the Tab bar results in an iPhone crash

I seem to be having an issue with loading a game on a tab in a tab bar application. When I run the app and click on the tab that the game is supposed to go on, it crashes giving me this in console:
2011-03-20 08:36:29.311 ComputerClan[21592:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x6948f30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key racquet_green.'
*** Call stack at first throw:
(
0 CoreFoundation 0x017ea5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0193e313 objc_exception_throw + 44
2 CoreFoundation 0x017ea4e1 -[NSException raise] + 17
3 Foundation 0x001a7677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x001a75e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0062b30c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x017608cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x00629d23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x0062bab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x004e1628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x004df134 -[UIViewController loadView] + 120
11 UIKit 0x004df00e -[UIViewController view] + 56
12 UIKit 0x004dd482 -[UIViewController contentScrollView] + 42
13 UIKit 0x004edf25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
14 UIKit 0x004ec555 -[UINavigationController _layoutViewController:] + 43
15 UIKit 0x004ed7aa -[UINavigationController _startTransition:fromViewController:toViewController:] + 326
16 UIKit 0x004e832a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
17 UIKit 0x004ef562 -[UINavigationController pushViewController:transition:forceImmediate:] + 932
18 UIKit 0x004e81c4 -[UINavigationController pushViewController:animated:] + 62
19 UIKit 0x004f469a -[UIMoreNavigationController pushViewController:animated:] + 105
20 UIKit 0x004a6b68 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
21 UIKit 0x0049cb05 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
22 Foundation 0x001ae79e __NSFireDelayedPerform + 441
23 CoreFoundation 0x017cb8c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
24 CoreFoundation 0x017cce74 __CFRunLoopDoTimer + 1220
25 CoreFoundation 0x017292c9 __CFRunLoopRun + 1817
26 CoreFoundation 0x01728840 CFRunLoopRunSpecific + 208
27 CoreFoundation 0x01728761 CFRunLoopRunInMode + 97
28 GraphicsServices 0x01dda1c4 GSEventRunModal + 217
29 GraphicsServices 0x01dda289 GSEventRun + 115
30 UIKit 0x0043dc93 UIApplicationMain + 1160
31 ComputerClan 0x00002b02 main + 84
32 ComputerClan 0x00002aa5 start + 53
)
terminate called after throwing an instance of 'NSException'
It seems as if you have a problem in the XIB you are trying to load. Make sure there are no invalid connections, i.e. connections to non-existent IBOutlets or IBActions. Also make sure you haven't defined any objects to be non-existent classes.