I have some beginner trouble using xCode. Each time the app crash I find it hard to find the problem as I don't understand the log currently I seem to have a problem with a Array. I think it is a Array of which I deleted the class where it was in.
I would like to know how I should read this log :
2014-05-02 10:49:32.808 myCompany[2793:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x017f21e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015718e5 objc_exception_throw + 44
2 CoreFoundation 0x017a4abc -[__NSArrayM insertObject:atIndex:] + 844
3 CoreFoundation 0x017a4760 -[__NSArrayM addObject:] + 64
4 UIKit 0x00794a4b PushNextClassForSettingIMP + 383
5 UIKit 0x00794838 __workaround10030904InvokeWithTarget_block_invoke + 29
6 UIKit 0x00284413 +[UIView _performCustomizableAppearanceModifications:] + 26
7 UIKit 0x00794810 workaround10030904InvokeWithTarget + 940
8 UIKit 0x0078ee71 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:] + 3779
9 UIKit 0x0078f633 +[_UIAppearance _applyInvocationsTo:window:] + 55
10 UIKit 0x0029b5a3 -[UIView(Internal) _applyAppearanceInvocations] + 270
11 UIKit 0x0029c002 __88-[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:]_block_invoke + 65
12 UIKit 0x0029bf8f -[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:] + 204
13 UIKit 0x0029bebe -[UIView(Internal) _didChangeFromIdiom:onScreen:traverseHierarchy:] + 52
14 UIKit 0x003f44b7 -[UILabel(_UIAccessibilityButtonShapesSupportInternal) _didChangeFromIdiom:onScreen:traverseHierarchy:] + 73
15 UIKit 0x004ed776 -[UITabBarButtonLabel _didChangeFromIdiom:onScreen:traverseHierarchy:] + 73
16 UIKit 0x0029be82 -[UIView(Internal) _didChangeFromIdiomOnScreen:traverseHierarchy:] + 172
17 UIKit 0x0029b466 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1624
18 UIKit 0x0029b109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 763
19 UIKit 0x00334458 -[UIControl _didMoveFromWindow:toWindow:] + 65
20 UIKit 0x0029b109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 763
21 UIKit 0x004fad59 -[UITabBar(UITabBarPrivate) _didMoveFromWindow:toWindow:] + 65
22 UIKit 0x0029b109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 763
23 UIKit 0x0029296f __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 158
24 UIKit 0x002927fb -[UIView(Hierarchy) _postMovedFromSuperview:] + 260
25 UIKit 0x0029ddd4 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1875
26 UIKit 0x00290dba -[UIView(Hierarchy) addSubview:] + 56
27 UIKit 0x00270406 -[UIWindow addRootViewControllerViewIfPossible] + 481
28 UIKit 0x002705ef -[UIWindow _setHidden:forced:] + 312
29 UIKit 0x0027086b -[UIWindow _orderFrontWithoutMakingKey] + 49
30 UIKit 0x0027b3c8 -[UIWindow makeKeyAndVisible] + 65
31 UIKit 0x0022bbc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097
32 UIKit 0x00230667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
33 UIKit 0x00244f92 -[UIApplication handleEvent:withNewEvent:] + 3517
34 UIKit 0x00245555 -[UIApplication sendEvent:] + 85
35 UIKit 0x00232250 _UIApplicationHandleEvent + 683
36 GraphicsServices 0x037e7f02 _PurpleEventCallback + 776
37 GraphicsServices 0x037e7a0d PurpleEventCallback + 46
38 CoreFoundation 0x0176dca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
39 CoreFoundation 0x0176d9db __CFRunLoopDoSource1 + 523
40 CoreFoundation 0x0179868c __CFRunLoopRun + 2156
41 CoreFoundation 0x017979d3 CFRunLoopRunSpecific + 467
42 CoreFoundation 0x017977eb CFRunLoopRunInMode + 123
43 UIKit 0x0022fd9c -[UIApplication _run] + 840
44 UIKit 0x00231f9b UIApplicationMain + 1225
45 myCompany 0x000043fd main + 141
46 libdyld.dylib 0x01e39701 start + 1
)
EDIT :
this caused the problem :
UIImage *tabBackground = [[UIImage imageNamed:#"image.PNG"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UITabBarItem appearance] setImage:tabBackground];
Still I don't understand why it can't just display the line of error like android. I found this by comment lining
I think you must follow up this tutorial, clearly mentioning about this
http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1
According to your log details,
You are trying to create array with nil objects.
Trying to insert nil object to array
both above will crash the app.
Enable zombies
Product->Edit Scheme->Diagnostics-> Click Enable Zombie Objects
You forgot to add nil at last index in array creation.
like this
NSArray *array = [NSArray arrayWithObjects:#"1",#"2"];
But it should be
NSArray *array = [NSArray arrayWithObjects:#"1",#"2",nil];
But If you are using NSMutableArray and add objects,then u should valid to nil condition like below.
if (myObjectToBeAddedToArray!=nil) {
[arrayMutable addObject:myObjectToBeAddedToArray];
}
Related
In my iOS app, I am using both Swift and Obj-c with an external library but for some reason I am getting a crash when the library adds a subview.
[view addSubview:self];
The stacktrace is as follows, which is quite hard to track the error as its not near the top(i think).
*** Terminating app due to uncaught exception 'NSRangeException', reason:
'*** -[__NSArrayM objectAtIndex:]: index 4 beyond bounds [0 .. 1]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010913ac65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108dd3bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000109024093 -[__NSArrayM objectAtIndex:] + 227
3 UIKit 0x0000000106fa1881 _UIViewTopDownSubtreeTraversal + 193
4 UIKit 0x00000001075c2fa3 -[UIView(UIConstraintBasedLayout_EngineDelegate) _invalidateSystemLayoutSizeFittingSizeAtEngineDelegateLevel] + 141
5 Foundation 0x00000001065e4d6f -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 915
6 Foundation 0x000000010676f1e8 -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 275
7 Foundation 0x00000001065d949a -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 220
8 UIKit 0x00000001075bfa34 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 474
9 Foundation 0x00000001065e71be -[NSISEngine withBehaviors:performModifications:] + 155
10 UIKit 0x00000001075bf83a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452
11 UIKit 0x00000001075bf64d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 197
12 UIKit 0x00000001075bf933 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 217
13 Foundation 0x00000001065e71be -[NSISEngine withBehaviors:performModifications:] + 155
14 UIKit 0x00000001075bf83a __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 452
15 UIKit 0x00000001075bf64d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 197
16 UIKit 0x00000001075bf2de -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 404
17 UIKit 0x00000001075b426e -[UIView(UIConstraintBasedLayout) _layoutEngine_windowDidChange] + 126
18 UIKit 0x0000000106fbf561 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 209
19 UIKit 0x0000000106fb7ecf __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 125
20 UIKit 0x0000000106fb7e43 -[UIView(Hierarchy) _postMovedFromSuperview:] + 437
21 UIKit 0x0000000106fc1f48 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1660
22 UIKit 0x0000000106f3765a -[_UIParallaxDimmingView didMoveToWindow] + 123
23 UIKit 0x0000000106fbfa68 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1496
24 UIKit 0x0000000106fbf74a -[UIView(Internal) _didMoveFromWindow:toWindow:] + 698
25 UIKit 0x0000000106fb7ecf __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 125
26 UIKit 0x0000000106fb7e43 -[UIView(Hierarchy) _postMovedFromSuperview:] + 437
27 UIKit 0x0000000106fc1f48 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1660
28 UIKit 0x0000000106f33f08 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 2101
29 UIKit 0x0000000106fbc68e +[UIView(Animation) performWithoutAnimation:] + 65
30 UIKit 0x0000000106f33342 -[_UINavigationParallaxTransition animateTransition:] + 1225
31 UIKit 0x000000010709abfc -[UINavigationController _startCustomTransition:] + 3038
32 UIKit 0x00000001070a63bf -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
33 UIKit 0x00000001070a6f0e -[UINavigationController __viewWillLayoutSubviews] + 43
34 UIKit 0x00000001071f1715 -[UILayoutContainerView layoutSubviews] + 202
35 UIKit 0x0000000106fc4a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
36 QuartzCore 0x00000001087e3ec2 -[CALayer layoutSublayers] + 146
37 QuartzCore 0x00000001087d86d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
38 QuartzCore 0x00000001087d8546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
39 QuartzCore 0x0000000108744886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
40 QuartzCore 0x0000000108745a3a _ZN2CA11Transaction6commitEv + 462
41 QuartzCore 0x00000001087460eb _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
42 CoreFoundation 0x000000010906dca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
43 CoreFoundation 0x000000010906dc00 __CFRunLoopDoObservers + 368
44 CoreFoundation 0x0000000109063a33 __CFRunLoopRun + 1123
45 CoreFoundation 0x0000000109063366 CFRunLoopRunSpecific + 470
46 GraphicsServices 0x000000010b1bfa3e GSEventRunModal + 161
47 UIKit 0x0000000106f44900 UIApplicationMain + 1282
48 HedgeEm 0x0000000104f1cfdf main + 111
49 libdyld.dylib 0x0000000109cff145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
My first thoughts were to look for anything that was using an array, but in my code there wasnt anything, I think its related to iOS adding the subview but failing.
Further investigation, the same implementation works in ios 7, I know its related to a possible constraint issue - maybe the compile time constraints that get added. I guess this serves me right for using an old library.
I was using the EAIntroView library EAIntroView - GitHub
It turns out that there is a problem with the library and the latest version causes a crash in iOS 8, GitHub - crash discussion So the solution is to downgrade to 2.6 and it works fine.
when i run my app, i received this error :
2014-08-11 10:52:10.546 ControlViewTest[918:60b] -[UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x8c862f0
2014-08-11 10:52:10.605 ControlViewTest[918:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x8c862f0'
* First throw call stack:
(
0 CoreFoundation 0x017ec1e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x0156b8e5 objc_exception_throw + 44
2 CoreFoundation 0x01889243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x017dc50b ___forwarding_ + 1019
4 CoreFoundation 0x017dc0ee _CF_forwarding_prep_0 + 14
5 UIKit 0x008b0c34 -[UICollectionViewData _updateItemCounts] + 331
6 UIKit 0x008b0ce1 -[UICollectionViewData _validateItemCounts] + 45
7 UIKit 0x008b2c64 -[UICollectionViewData numberOfSections] + 35
8 UIKit 0x0087d6ed -[UICollectionView numberOfSections] + 62
9 UIKit 0x0089d614 -[UICollectionViewFlowLayout(Internal) _getSizingInfos] + 205
10 UIKit 0x0089e48f -[UICollectionViewFlowLayout(Internal) _fetchItemsInfo] + 521
11 UIKit 0x00899fe2 -[UICollectionViewFlowLayout prepareLayout] + 157
12 UIKit 0x008b0d9d -[UICollectionViewData _prepareToLoadData] + 76
13 UIKit 0x008b15c5 -[UICollectionViewData validateLayoutInRect:] + 56
14 UIKit 0x00877603 -[UICollectionView layoutSubviews] + 173
15 UIKit 0x0029a964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
16 libobjc.A.dylib 0x0157d82b -[NSObject performSelector:withObject:] + 70
17 QuartzCore 0x03c5745a -[CALayer layoutSublayers] + 148
18 QuartzCore 0x03c4b244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
19 QuartzCore 0x03c573a5 -[CALayer layoutIfNeeded] + 160
20 UIKit 0x0035cae3 -[UIViewController window:setupWithInterfaceOrientation:] + 304
21 UIKit 0x00272aa7 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5212
22 UIKit 0x00271646 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
23 UIKit 0x00271518 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117
24 UIKit 0x002715a0 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67
25 UIKit 0x0027063a 57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120
26 UIKit 0x0027059c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
27 UIKit 0x002712f3 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870
28 UIKit 0x002748e6 -[UIWindow setDelegate:] + 449
29 UIKit 0x0034eb77 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180
30 UIKit 0x0026a474 -[UIWindow addRootViewControllerViewIfPossible] + 591
31 UIKit 0x0026a5ef -[UIWindow _setHidden:forced:] + 312
32 UIKit 0x0026a86b -[UIWindow _orderFrontWithoutMakingKey] + 49
33 UIKit 0x002753c8 -[UIWindow makeKeyAndVisible] + 65
34 UIKit 0x00225bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097
35 UIKit 0x0022a667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
36 UIKit 0x0023ef92 -[UIApplication handleEvent:withNewEvent:] + 3517
37 UIKit 0x0023f555 -[UIApplication sendEvent:] + 85
38 UIKit 0x0022c250 _UIApplicationHandleEvent + 683
39 GraphicsServices 0x037e1f02 _PurpleEventCallback + 776
40 GraphicsServices 0x037e1a0d PurpleEventCallback + 46
41 CoreFoundation 0x01767ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53
42 CoreFoundation 0x017679db __CFRunLoopDoSource1 + 523
43 CoreFoundation 0x0179268c __CFRunLoopRun + 2156
44 CoreFoundation 0x017919d3 CFRunLoopRunSpecific + 467
45 CoreFoundation 0x017917eb CFRunLoopRunInMode + 123
46 UIKit 0x00229d9c -[UIApplication _run] + 840
47 UIKit 0x0022bf9b UIApplicationMain + 1225
48 ControlViewTest 0x0000264d main + 141
49 libdyld.dylib 0x01e33701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
somebody can help me pls
Your UICollectionView has a data source set which does not implement the required method collectionView:numberOfItemsInSection:. You need to assign your UICollectionView a valid data source: a class that you've written and that implements collectionView:numberOfItemsInSection:.
Can I get helped with the below issue? I'm struck over here. While executing the code I'm getting this log. I couldn't find the solution for it. I tried it for the whole day but couldn't find the solution for it.
2014-05-29 10:34:35.723 Timesheet[14438:60b] -[UITableViewCell setAlternateRowColor:]: unrecognized selector sent to instance 0x8f98a70
2014-05-29 10:34:35.764 Timesheet[14438:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCell setAlternateRowColor:]: unrecognized selector sent to instance 0x8f98a70'
*** First throw call stack:
(
0 CoreFoundation 0x0180a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015898e5 objc_exception_throw + 44
2 CoreFoundation 0x018a7243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x017fa50b ___forwarding___ + 1019
4 CoreFoundation 0x017fa0ee _CF_forwarding_prep_0 + 14
5 Timesheet 0x00002e13 -[ViewController tableView:cellForRowAtIndexPath:] + 691
6 UIKit 0x0034211f -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 412
7 UIKit 0x003421f3 -[UITableView _createPreparedCellForGlobalRow:] + 69
8 UIKit 0x00323ece -[UITableView _updateVisibleCellsNow:] + 2428
9 UIKit 0x003386a5 -[UITableView layoutSubviews] + 213
10 UIKit 0x002b8964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
11 libobjc.A.dylib 0x0159b82b -[NSObject performSelector:withObject:] + 70
12 QuartzCore 0x03c7545a -[CALayer layoutSublayers] + 148
13 QuartzCore 0x03c69244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
14 QuartzCore 0x03c77885 -[CALayer(CALayerPrivate) layoutBelowIfNeeded] + 43
15 UIKit 0x002ab026 -[UIView(Hierarchy) layoutBelowIfNeeded] + 595
16 UIKit 0x002aadcd -[UIView(Hierarchy) layoutIfNeeded] + 74
17 UIKit 0x0038e744 -[UINavigationController _layoutViewController:] + 1062
18 UIKit 0x0038d966 -[UINavigationController _layoutTopViewController] + 176
19 UIKit 0x0038bb95 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 429
20 UIKit 0x0058f74e -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 328
21 UIKit 0x0058fa53 -[UINavigationTransitionView _cleanupTransition] + 703
22 UIKit 0x0058fa92 -[UINavigationTransitionView _navigationTransitionDidStop] + 55
23 UIKit 0x002996dc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
24 UIKit 0x00297ec5 +[UIViewAnimationState popAnimationState] + 334
25 UIKit 0x002ad123 +[UIView(Animation) commitAnimations] + 36
26 UIKit 0x0058f551 -[UINavigationTransitionView transition:fromView:toView:] + 2795
27 UIKit 0x0058ea5e -[UINavigationTransitionView transition:toView:] + 55
28 UIKit 0x0038f577 -[UINavigationController _startTransition:fromViewController:toViewController:] + 3186
29 UIKit 0x0038f8cc -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
30 UIKit 0x003904e9 -[UINavigationController __viewWillLayoutSubviews] + 57
31 UIKit 0x004d10d1 -[UILayoutContainerView layoutSubviews] + 213
32 UIKit 0x002b8964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
33 libobjc.A.dylib 0x0159b82b -[NSObject performSelector:withObject:] + 70
34 QuartzCore 0x03c7545a -[CALayer layoutSublayers] + 148
35 QuartzCore 0x03c69244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
36 QuartzCore 0x03c753a5 -[CALayer layoutIfNeeded] + 160
37 UIKit 0x0037aae3 -[UIViewController window:setupWithInterfaceOrientation:] + 304
38 UIKit 0x00290aa7 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5212
39 UIKit 0x0028f646 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
40 UIKit 0x0028f518 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117
41 UIKit 0x0028f5a0 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67
42 UIKit 0x0028e63a __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120
43 UIKit 0x0028e59c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
44 UIKit 0x0028f2f3 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870
45 UIKit 0x002928e6 -[UIWindow setDelegate:] + 449
46 UIKit 0x0036cb77 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180
47 UIKit 0x00288474 -[UIWindow addRootViewControllerViewIfPossible] + 591
48 UIKit 0x002885ef -[UIWindow _setHidden:forced:] + 312
49 UIKit 0x0028886b -[UIWindow _orderFrontWithoutMakingKey] + 49
50 UIKit 0x002933c8 -[UIWindow makeKeyAndVisible] + 65
51 UIKit 0x00243bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097
52 UIKit 0x00248667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
53 UIKit 0x0025cf92 -[UIApplication handleEvent:withNewEvent:] + 3517
54 UIKit 0x0025d555 -[UIApplication sendEvent:] + 85
55 UIKit 0x0024a250 _UIApplicationHandleEvent + 683
56 GraphicsServices 0x037fff02 _PurpleEventCallback + 776
57 GraphicsServices 0x037ffa0d PurpleEventCallback + 46
58 CoreFoundation 0x01785ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
59 CoreFoundation 0x017859db __CFRunLoopDoSource1 + 523
60 CoreFoundation 0x017b068c __CFRunLoopRun + 2156
61 CoreFoundation 0x017af9d3 CFRunLoopRunSpecific + 467
62 CoreFoundation 0x017af7eb CFRunLoopRunInMode + 123
63 UIKit 0x00247d9c -[UIApplication _run] + 840
64 UIKit 0x00249f9b UIApplicationMain + 1225
65 Timesheet 0x0000b60d main + 141
66 libdyld.dylib 0x01eeb701 start + 1
67 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Have you looked into:
2014-05-29 10:34:35.723 Timesheet[14438:60b] -[UITableViewCell setAlternateRowColor:]
?
setAlternateRowColor is not a valid setter on UITableViewCell. without seeing the code it's difficult to guess what the error might be, but you are using the cell improperly.
We have a failry complex mobile application that uses a static table view for input. With the update to ios 7.1 we are now getting a crash after a user goes through a few text fields without entering information, then enters something and moves to the next text field. The crash is
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' setObjectForKey: object cannot be nil (key: NSShadow)'
with this stack trace:
* First throw call stack: (
0 CoreFoundation 0x000000010342b495 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010318a99e objc_exception_throw + 43
2 CoreFoundation 0x00000001034aa544 -[NSDictionaryM setObject:forKey:] + 916
3 UIKit 0x0000000101eb877c -[UILabel setShadow:] + 339
4 UIKit 0x0000000101eb88b5 -[UILabel setShadowColor:] + 100
5 CoreFoundation 0x0000000103420f1c invoking + 140
6 CoreFoundation 0x00000001034b0e84 -[NSInvocation invokeUsingIMP:] + 212
7 UIKit 0x00000001021f0b4d workaround10030904InvokeWithTarget_block_invoke + 88
8 UIKit 0x0000000101d7eecb +[UIView _performCustomizableAppearanceModifications:] + 33
9 UIKit 0x00000001021f0ae3 workaround10030904InvokeWithTarget + 938
10 UIKit 0x00000001021ebfc9 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:] + 3482
11 UIKit 0x0000000101d938fa 88-[UIView(Internal) performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:]block_invoke + 63
12 UIKit 0x0000000101d93885 -[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:] + 230
13 UIKit 0x0000000101d92e2c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1369
14 UIKit 0x0000000101d8b996 45-[UIView(Hierarchy) postMovedFromSuperview:]_block_invoke + 128
15 UIKit 0x0000000101d8b85c -[UIView(Hierarchy) _postMovedFromSuperview:] + 276
16 UIKit 0x0000000101d952ac -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1508
17 UIKit 0x000000010237d922 -[UITextField willDetachFieldEditor:] + 96
18 UIKit 0x0000000101e1b48e -[UIFieldEditor becomeFieldEditorForView:] + 236
19 UIKit 0x0000000102375497 -[UITextField _resignFirstResponder] + 197
20 UIKit 0x0000000101e6b212 -[UIResponder resignFirstResponder] + 128
21 UIKit 0x00000001023752db -[UITextField resignFirstResponder] + 114
22 UIKit 0x0000000101e6b011 -[UIResponder becomeFirstResponder] + 297
23 UIKit 0x0000000101d8b673 -[UIView(Hierarchy) becomeFirstResponder] + 99
24 UIKit 0x0000000102374b08 -[UITextField becomeFirstResponder] + 51
25 UIKit 0x0000000102067d01 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 187
26 UIKit 0x0000000102069b30 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 1768
27 UIKit 0x000000010205ffc2 _UIGestureRecognizerSendActions + 188
28 UIKit 0x000000010205ef28 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 357
29 UIKit 0x00000001020632d9 UIGestureRecognizerUpdate_block_invoke + 53
30 UIKit 0x0000000102063261 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 257
31 UIKit 0x000000010205b337 _UIGestureRecognizerUpdate + 93
32 UIKit 0x0000000101d6fa15 -[UIWindow _sendGesturesForEvent:] + 928
33 UIKit 0x0000000101d706d4 -[UIWindow sendEvent:] + 909
34 UIKit 0x0000000101d4829a -[UIApplication sendEvent:] + 211
35 UIKit 0x0000000101d35aed _UIApplicationHandleEventQueue + 9579
36 CoreFoundation 0x00000001033bad21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
37 CoreFoundation 0x00000001033ba5f2 CFRunLoopDoSources0 + 242
38 CoreFoundation 0x00000001033d646f CFRunLoopRun + 767
39 CoreFoundation 0x00000001033d5d83 CFRunLoopRunSpecific + 467
40 GraphicsServices 0x000000010524cf04 GSEventRunModal + 161
41 UIKit 0x0000000101d37e33 UIApplicationMain + 1010
42 Sales Rabbit 0x000000010000c333 main + 115
43 libdyld.dylib 0x0000000103ac35fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
As far as I can tell the crash is happening when we call
[curView becomeFirstResponder];
curView is not nil, and is a uitextfield
Any ideas on what to check or help would be greatly appreciated.
So I ended up finding the answer, for some reason someone had written this line of code even though it doesnt seem necessary.
[[UILabel appearance] setShadowColor:[UIColor clearColor]];
And this was causing it to crash, but only in the situation that I described above, not when it was set in the app delegate. It seems like it should be allowed to set a the shadow color to clear, although why you would do this is not apparent to me.
Weird error. My code was written in Xcode 3, and it loaded fine in 4.4 without errors.
Recently, it started not working in OS 4.3 or below, but fine in 5.0 and 5.1. I've done a few weeks of updating my app, so I have no idea where it went out of whack (I was using the current simulator 5.1 when testing, so I didn't even think to try the others after each trial).
Here is my error log, but I can't figure out whats causing the crash. It should note that I get "location services not available" when launching in 4.3 or below, but not in 5.0 and above. It crashes about the time I try to load a view that has a table. Here is my debugger info... any ideas?
> 2012-09-03 05:43:39.582 Diners[7811:12203] [-[MapViewController viewDidLoad] /Users/user/Documents/Source Code/Working Projects/Diners/Classes/MapViewController.m:48]
bootstrap_look_up failed (44e)
2012-09-03 05:43:42.997 Diners[7811:12203] [-[StripClubsAppDelegate i3fSplashViewBrickDidRemoveFromSuperview:] /Users/user/Documents/Source Code/Working Projects/Diners/Classes/StripClubsAppDelegate.m:77]
2012-09-03 05:43:49.883 Diners[7811:12203] -[UITapGestureRecognizer initWithCoder:]: unrecognized selector sent to instance 0x5fe01b0
2012-09-03 05:43:49.950 Diners[7811:12203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITapGestureRecognizer initWithCoder:]: unrecognized selector sent to instance 0x5fe01b0'
*** Call stack at first throw:
(
0 CoreFoundation 0x014585a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01205313 objc_exception_throw + 44
2 CoreFoundation 0x0145a0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x013c9966 ___forwarding___ + 966
4 CoreFoundation 0x013c9522 _CF_forwarding_prep_0 + 50
5 UIKit 0x0061c9fd UINibDecoderDecodeObjectForValue + 2592
6 UIKit 0x0061d6ac -[UINibDecoder decodeObjectForKey:] + 398
7 UIKit 0x0053293e -[UIRuntimeConnection initWithCoder:] + 153
8 UIKit 0x00532ee7 -[UIRuntimeEventConnection initWithCoder:] + 64
9 UIKit 0x0061c9fd UINibDecoderDecodeObjectForValue + 2592
10 UIKit 0x0061c2f5 UINibDecoderDecodeObjectForValue + 792
11 UIKit 0x0061d6ac -[UINibDecoder decodeObjectForKey:] + 398
12 UIKit 0x00531c36 -[UINib instantiateWithOwner:options:] + 804
13 UIKit 0x00533ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
14 UIKit 0x003e9628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
15 UIKit 0x003e7134 -[UIViewController loadView] + 120
16 UIKit 0x003e700e -[UIViewController view] + 56
17 UIKit 0x003e5482 -[UIViewController contentScrollView] + 42
18 UIKit 0x003f5f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
19 UIKit 0x003f4555 -[UINavigationController _layoutViewController:] + 43
20 UIKit 0x003f5870 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
21 UIKit 0x003f032a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
22 UIKit 0x003f7562 -[UINavigationController pushViewController:transition:forceImmediate:] + 932
23 UIKit 0x003f01c4 -[UINavigationController pushViewController:animated:] + 62
24 Diners 0x00002c83 -[MapViewController goToListByState] + 275
25 UIKit 0x003374fd -[UIApplication sendAction:to:from:forEvent:] + 119
26 UIKit 0x003c7799 -[UIControl sendAction:to:forEvent:] + 67
27 UIKit 0x003c9c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
28 UIKit 0x003c8a1c -[UIControl touchesBegan:withEvent:] + 277
29 UIKit 0x0035bd41 -[UIWindow _sendTouchesForEvent:] + 395
30 UIKit 0x0033cc37 -[UIApplication sendEvent:] + 447
31 UIKit 0x00341f2e _UIApplicationHandleEvent + 7576
32 GraphicsServices 0x01a2e992 PurpleEventCallback + 1550
33 CoreFoundation 0x01439944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
34 CoreFoundation 0x01399cf7 __CFRunLoopDoSource1 + 215
35 CoreFoundation 0x01396f83 __CFRunLoopRun + 979
36 CoreFoundation 0x01396840 CFRunLoopRunSpecific + 208
37 CoreFoundation 0x01396761 CFRunLoopRunInMode + 97
38 GraphicsServices 0x01a2d1c4 GSEventRunModal + 217
39 GraphicsServices 0x01a2d289 GSEventRun + 115
40 UIKit 0x00345c93 UIApplicationMain + 1160
41 Diners 0x0000203d main + 125
42 Diners 0x00001fb5 start + 53
)
terminate called throwing an exception(lldb)
It seems that you add a gesture recognizer using interface builder, this feature is only available for ios5 and more.