I am newbie for iOS Please help ,When I run the code for the first time, it runs successfully in emulator along with the correct output. Now for the same code it show the following error:
2015-10-09 11:25:30.569 ViewController[1417:44846] * Terminating app
due to uncaught exception 'NSUnknownKeyException', reason:
'[ setValue:forUndefinedKey:]: this
class is not key value coding-compliant for the key outlinebtn.'
* First throw call stack:
( 0 CoreFoundation 0x000000010c840f35
exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010c130bb7 objc_exception_throw + 45 2 CoreFoundation
0x000000010c840b79 -[NSException raise] + 9 3 Foundation
0x000000010bccd7b3 -[NSObject(NSKeyValueCoding) setValue:forKey:] +
259 4 CoreFoundation 0x000000010c78ae80
-[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x000000010cef2c7d -[UINib instantiateWithOwner:options:] + 1506 6
UIKit 0x000000010cd51f98
-[UIViewController _loadViewFromNibNamed:bundle:] + 242 7 UIKit 0x000000010cd52588 -[UIViewController loadView] + 109 8 UIKit
0x000000010cd527f9 -[UIViewController loadViewIfRequired] + 75 9
UIKit 0x000000010cd52c8e
-[UIViewController view] + 27 10 UIKit 0x000000010cc71ca9 -[UIWindow addRootViewControllerViewIfPossible] +
58 11 UIKit 0x000000010cc72041
-[UIWindow _setHidden:forced:] + 247 12 UIKit 0x000000010cc7e72c -[UIWindow makeKeyAndVisible] + 42 13 UIKit
0x000000010cc29061 -[UIApplication
_callInitializationDelegatesForMainScene:transitionContext:] + 2628 14 UIKit 0x000000010cc2bd2c
-[UIApplication _runWithMainScene:transitionContext:completion:] + 1350 15 UIKit 0x000000010cc2abf2
-[UIApplication workspaceDidEndTransaction:] + 179 16 FrontBoardServices 0x000000010f3e92a3
__31-[FBSSerialQueue performAsync:]_block_invoke + 16 17 CoreFoundation 0x000000010c77653c
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 18 CoreFoundation 0x000000010c76c285 __CFRunLoopDoBlocks + 341 19 CoreFoundation
0x000000010c76ba43 __CFRunLoopRun + 851 20 CoreFoundation
0x000000010c76b486 CFRunLoopRunSpecific + 470 21 UIKit
0x000000010cc2a669 -[UIApplication _run] + 413 22 UIKit
0x000000010cc2d420 UIApplicationMain + 1282 23 ViewController
0x000000010bc01e43 main + 115 24 libdyld.dylib
0x000000010edd0145 start + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException (lldb)
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
#autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
What to do ??/ please help me. I am new for iOS
Related
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.
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.
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.
On the console it shows....
2011-09-29 17:06:39.564 Project AddressBook[925:207] * Terminating
app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Could not load NIB in bundle: 'NSBundle
(loaded)' with name 'eve''
* Call stack at first throw: ( 0 CoreFoundation
0x00e655a9 exceptionPreprocess + 185 1 libobjc.A.dylib
0x00fb9313 objc_exception_throw + 44 2 CoreFoundation
0x00e1def8 +[NSException raise:format:arguments:] + 136 3
CoreFoundation 0x00e1de6a +[NSException
raise:format:] + 58 4 UIKit
0x005500fa -[UINib instantiateWithOwner:options:] + 2024 5 UIKit
0x00551ab7 -[NSBundle(UINSBundleAdditions)
loadNibNamed:owner:options:] + 168 6 UIKit
0x00407628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70 7
UIKit 0x00405134 -[UIViewController
loadView] + 120 8 UIKit 0x0040500e
-[UIViewController view] + 56 9 UIKit
0x00406a3d -[UIViewController viewControllerForRotation] + 63 10
UIKit 0x00402988 -[UIViewController
_visibleView] + 90 11 UIKit 0x006a493c
-[UIClientRotationContext
initWithClient:toOrientation:duration:andWindow:] + 354 12 UIKit
0x0037c81e -[UIWindow
_setRotatableClient:toOrientation:updateStatusBar:duration:force:] +
954 13 UIKit 0x00604619
-[UIWindowController
transition:fromViewController:toViewController:target:didEndSelector:]
+ 1381 14 UIKit 0x0040965d
-[UIViewController presentModalViewController:withTransition:] + 3478
15 Project AddressBook 0x000032cb -[Home Events:] +
155 16 UIKit 0x003554fd
-[UIApplication sendAction:to:from:forEvent:] + 119 17 UIKit
0x003e5799 -[UIControl sendAction:to:forEvent:] + 67 18 UIKit
0x003e7c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] +
527 19 UIKit 0x003e67d8 -[UIControl
touchesEnded:withEvent:] + 458 20 UIKit
0x00379ded -[UIWindow _sendTouchesForEvent:] + 567 21 UIKit
0x0035ac37 -[UIApplication sendEvent:] + 447 22 UIKit
0x0035ff2e _UIApplicationHandleEvent + 7576 23 GraphicsServices
0x01723992 PurpleEventCallback + 1550 24 CoreFoundation
0x00e46944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
+ 52 25 CoreFoundation 0x00da6cf7
__CFRunLoopDoSource1 + 215 26 CoreFoundation
0x00da3f83 __CFRunLoopRun + 979 27 CoreFoundation
0x00da3840 CFRunLoopRunSpecific + 208 28 CoreFoundation
0x00da3761 CFRunLoopRunInMode + 97 29 GraphicsServices
0x017221c4 GSEventRunModal + 217 30 GraphicsServices
0x01722289 GSEventRun + 115 31 UIKit
0x00363c93 UIApplicationMain + 1160 32 Project AddressBook
0x00002828 main + 102 33 Project AddressBook
0x000027b9 start + 53 ) terminate called after throwing an instance of
'NSException' sharedlibrary apply-load-rules all Current language:
auto; currently objective
HELP ME PLEASE!!
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'eve''
Your problem is exactly this. You try to load a nib file named 'eve'.
Somewhere you call something like this:
VC *aVC = [[[VC alloc] initWithNibName:#"eve" bundle:nil] autorelease];
Xcode 4 should show you the call stack when it hits that exception. And in the source window it should show you the code where it happened. Three or four lines above that line is your problem.
I am getting an error while running app with following exception.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FavoriteViewController 0x158d30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
*** Call stack at first throw:
(
0 CoreFoundation 0x314d0987 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x319a149d objc_exception_throw + 24
2 CoreFoundation 0x314d0705 -[NSException dealloc] + 0
3 Foundation 0x31d28b4f -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 182
4 Foundation 0x31d2803b _NSSetUsingKeyValueSetter + 90
5 Foundation 0x31d29da3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 194
6 Foundation 0x31cdbb17 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 130
7 UIKit 0x33a8860f -[UIRuntimeOutletConnection connect] + 66
8 CoreFoundation 0x31473fc7 -[NSObject(NSObject) performSelector:] + 18
9 CoreFoundation 0x3147cd51 -[NSArray makeObjectsPerformSelector:] + 388
10 UIKit 0x33a87577 -[UINib instantiateWithOwner:options:] + 586
11 UIKit 0x33a88b39 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
12 Fridge 0x0001ab11 -[FavoriteViewController tableView:cellForRowAtIndexPath:] + 192
13 UIKit 0x33907a21 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 516
14 UIKit 0x339077f3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 34
15 UIKit 0x33905d2d -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 936
16 UIKit 0x33904edd -[UITableView layoutSubviews] + 140
17 UIKit 0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
18 CoreFoundation 0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
19 QuartzCore 0x30a6c685 -[CALayer layoutSublayers] + 120
20 QuartzCore 0x30a6c43d CALayerLayoutIfNeeded + 184
21 QuartzCore 0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
22 QuartzCore 0x30a66383 _ZN2CA11Transaction6commitEv + 190
23 QuartzCore 0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
24 CoreFoundation 0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
25 CoreFoundation 0x31460acd __CFRunLoopDoObservers + 412
26 CoreFoundation 0x314580cb __CFRunLoopRun + 854
27 CoreFoundation 0x31457c87 CFRunLoopRunSpecific + 230
28 CoreFoundation 0x31457b8f CFRunLoopRunInMode + 58
29 GraphicsServices 0x35d664ab GSEventRunModal + 114
30 GraphicsServices 0x35d66557 GSEventRun + 62
31 UIKit 0x338d5329 -[UIApplication _run] + 412
32 UIKit 0x338d2e93 UIApplicationMain + 670
33 Fridge 0x00002d77 main + 70
34 Fridge 0x00002d2c start + 40
)
The error message: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
... means that your xib is referencing an IBOutlet named "customCell" but your view controller doesn't have that IBOutlet anymore. You either need to remove the customCell reference from your xib or add an IBOutlet property to your view controller named "customCell".