UITableView tableHeaderView crash using beginUpdates/endUpdates settings - ios

When I was setting UITableView tableHeaderView using beginUpdates&endUpdates,every day there will be dozens of crash in line 259
code:
[self.tableView beginUpdates];
self.tableView.tableHeaderView=self.topView;
[self.tableView endUpdates]; // line 259 crash
Below is the crash information:
13 UIKit 0x18fe43090 UIViewAlertForUnsatisfiableConstraints + 66
14 Foundation 0x18a0b94cc -[NSISEngine handleUnsatisfiableRowWithHead:body:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 464
15 Foundation 0x18a099df8 -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 384
16 Foundation 0x18a0959c4 -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 688
17 Foundation 0x18a0955cc -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 284
18 Foundation 0x18a0931e0 -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 272
19 UIKit 0x18f5ee400 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 396
20 Foundation 0x18a092d10 -[NSISEngine withBehaviors:performModifications:] + 168
21 UIKit 0x18f5ee20c __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 564
22 UIKit 0x18f4eab14 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 224
23 UIKit 0x18f5ee338 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 196
24 Foundation 0x18a092d10 -[NSISEngine withBehaviors:performModifications:] + 168
25 UIKit 0x18f5ee20c __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 564
26 UIKit 0x18f4eab14 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 224
27 UIKit 0x18f62bcf0 -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 460
28 UIKit 0x18f5eb334 -[UIView(AdditionalLayoutSupport) _layoutEngineCreateIfNecessary] + 64
29 UIKit 0x18f5eafc8 -[UIView(UIConstraintBasedLayout) _tryToAddConstraint:roundingAdjustment:mutuallyExclusiveConstraints:] + 132
30 UIKit 0x18f5eed28 -[UIView(UIConstraintBasedLayout) _updateContentSizeConstraints] + 872
31 UIKit 0x18fe3f1f8 -[UIView(AdditionalLayoutSupport) _updateSystemConstraints] + 116
32 UIKit 0x18f5f05a8 -[UIButton updateConstraints] + 3412
33 UIKit 0x18fe3de80 -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 192
34 UIKit 0x18fe3e1d0 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 632
35 UIKit 0x18fe3e158 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 512
36 UIKit 0x18fe3e158 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 512
37 UIKit 0x18fe3e974 __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 84
38 UIKit 0x18fe3db30 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 136
39 UIKit 0x18fe3e580 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 164
40 UIKit 0x18fe3f58c -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 372
41 UIKit 0x18f500328 -[UIView(Hierarchy) layoutBelowIfNeeded] + 544
42 UIKit 0x18f4fc7dc +[UIView(Animation) performWithoutAnimation:] + 104
43 UIKit 0x18f821b2c __46-[UITableView _updateWithItems:updateSupport:]_block_invoke.996 + 1984
44 UIKit 0x18f5240f0 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 636

Just remove [self.tableView beginUpdates];and[self.tableView endUpdates];

how are you setting the constraints on self.topView ? Looking at the stacktrace, it seems like the system cannot satisfy all the constraints. I would look at topView and make sure that all the constraints are valid.

Related

Crashed Foundation EXC_BAD_ACCESS KERN_INVALID_ADDRESS

We are having a crash in Foundation, but we are unable to detect what could be the problem. We think that maybe an animation could trigger this problem.
Has anybody encounter this kind of crash? Here is the trace of the problem.
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x1dfc44e6 objc_msgSend + 5
1 Foundation 0x1f7b0e77 -[_NSConcreteObservation dealloc] + 96
2 libobjc.A.dylib 0x1dfd1195 objc_object::sidetable_release(bool) + 238
3 Foundation 0x1f679e9d empty + 32
4 Foundation 0x1f5d4787 -[NSConcreteMapTable removeAllItems] + 76
5 UIKit 0x246e5259 -[UIView(AdditionalLayoutSupport) _clearLayoutVariableObservationsOnlyToSupportTAMICChange:] + 56
6 UIKit 0x23efaa0b __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 380
7 Foundation 0x1f5f7b03 -[NSISEngine withBehaviors:performModifications:] + 262
8 UIKit 0x23df6e8b -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 220
9 UIKit 0x23efab91 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 170
10 UIKit 0x23efaaa7 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 536
11 Foundation 0x1f5f7b03 -[NSISEngine withBehaviors:performModifications:] + 262
12 UIKit 0x23df6e8b -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 220
13 UIKit 0x23efab91 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 170
14 UIKit 0x23efaaa7 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 536
15 Foundation 0x1f5f7b03 -[NSISEngine withBehaviors:performModifications:] + 262
16 UIKit 0x23df6e8b -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 220
17 UIKit 0x23df6737 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 92
18 Foundation 0x1f5f7b03 -[NSISEngine withBehaviors:performModifications:] + 262
19 UIKit 0x23df6607 -[UIView(Hierarchy) _postMovedFromSuperview:] + 754
20 UIKit 0x240e8949 __UIViewWasRemovedFromSuperview + 154
21 UIKit 0x23df57a5 -[UIView(Hierarchy) removeFromSuperview] + 1188
22 UIKit 0x24768167 __46-[UIInputWindowController invalidateInputView]_block_invoke + 120
23 UIKit 0x241872b9 -[UIResponder _preserveResponderOverridesWhilePerforming:] + 108
24 UIKit 0x247680eb -[UIInputWindowController invalidateInputView] + 108
25 UIKit 0x24768a17 -[UIInputWindowController changeToInputViewSet:] + 240
26 UIKit 0x24769d91 __43-[UIInputWindowController setInputViewSet:]_block_invoke.1331 + 26
27 UIKit 0x2476382d __77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke.932 + 404
28 UIKit 0x23e3363b -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 440
29 UIKit 0x23e33109 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 214
30 UIKit 0x23e32f91 -[UIViewAnimationState animationDidStop:finished:] + 128
31 QuartzCore 0x21c06ee7 CA::Layer::run_animation_callbacks(void*) + 252
32 libdispatch.dylib 0x1e3fa083 _dispatch_client_callout + 22
33 libdispatch.dylib 0x1e3fe5fd _dispatch_main_queue_callback_4CF + 890
34 CoreFoundation 0x1ed104a7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
35 CoreFoundation 0x1ed0e78f __CFRunLoopRun + 1422
36 CoreFoundation 0x1ec5d533 CFRunLoopRunSpecific + 486
37 CoreFoundation 0x1ec5d341 CFRunLoopRunInMode + 104
38 GraphicsServices 0x20434bfd GSEventRunModal + 156
39 UIKit 0x23e65e67 -[UIApplication _run] + 574
40 UIKit 0x23e60591 UIApplicationMain + 150
41 App 0xb3c158 main (AppDelegate.swift:22)
42 libdispatch.dylib 0x1e42750b (Missing)

Autolayout works great on iOS 8, crashes on iOS 7

I have an issue where a screen with autolayout that works great on iOS 8 - but crashes on iOS 7.
All subviews are configured in the XIB.
The error message is:
Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to install constraint on view.
Does the constraint reference something from outside the subtree of the view? That's illegal.
constraint:<NSLayoutConstraint:0x7ef80720 V:[UIImageView:0x7ef7fb40]-(0)-[UILabel:0x7ef802f0]> view:<UIView: 0x7ef7f1e0; frame = (0 0; 768 275); autoresize = RM+BM; layer = <CALayer: 0x7ef7f240>>'
Here's the stack trace:
(
0 CoreFoundation 0x0588a1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0563d8e5 objc_exception_throw + 44
2 CoreFoundation 0x05889fbb +[NSException raise:format:] + 139
3 Foundation 0x0284d55f -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 197
4 Foundation 0x028509ad -[NSLayoutConstraint _addToEngine:] + 56
5 UIKit 0x0460c974 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 515
6 Foundation 0x029c768c -[NSISEngine withBehaviors:performModifications:] + 107
7 Foundation 0x028573c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
8 UIKit 0x0460ce40 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 63
9 UIKit 0x0460c754 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 476
10 UIKit 0x0460ce48 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 71
11 UIKit 0x0460c54f -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 223
12 UIKit 0x0460c46b -[UIView(AdditionalLayoutSupport) _parentalLayoutEngineDidChangeTo:] + 55
13 UIKit 0x0460c850 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 223
14 Foundation 0x029c768c -[NSISEngine withBehaviors:performModifications:] + 107
15 Foundation 0x028573c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
16 UIKit 0x0460ce40 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 63
17 UIKit 0x0460c754 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 476
18 UIKit 0x0460ce48 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 71
19 UIKit 0x0460c54f -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 223
20 UIKit 0x0460c46b -[UIView(AdditionalLayoutSupport) _parentalLayoutEngineDidChangeTo:] + 55
21 UIKit 0x0460c850 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 223
22 Foundation 0x029c768c -[NSISEngine withBehaviors:performModifications:] + 107
23 Foundation 0x028573c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
24 UIKit 0x0460ce40 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 63
25 UIKit 0x0460c754 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 476
26 UIKit 0x0460ce48 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 71
27 UIKit 0x0460c54f -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 223
28 UIKit 0x0460c46b -[UIView(AdditionalLayoutSupport) _parentalLayoutEngineDidChangeTo:] + 55
29 UIKit 0x03fd0948 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 119
30 Foundation 0x029c768c -[NSISEngine withBehaviors:performModifications:] + 107
31 Foundation 0x028573c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
32 UIKit 0x03fd0830 -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
33 UIKit 0x03fdbdd4 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1875
34 UIKit 0x03fcedba -[UIView(Hierarchy) addSubview:] + 56
35 UIKit 0x03f66645 -[_UIParallaxDimmingView didMoveToWindow] + 129
36 UIKit 0x03fd9478 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1642
37 UIKit 0x03fd9109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 763
38 UIKit 0x03fd096f __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 158
39 Foundation 0x029c768c -[NSISEngine withBehaviors:performModifications:] + 107
40 Foundation 0x028573c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
41 UIKit 0x03fd0830 -[UIView(Hierarchy) _postMovedFromSuperview:] + 313
42 UIKit 0x03fdbdd4 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1875
43 UIKit 0x03fcedba -[UIView(Hierarchy) addSubview:] + 56
44 UIKit 0x03f630f2 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 2001
45 UIKit 0x03fd581f +[UIView(Animation) performWithoutAnimation:] + 82
46 UIKit 0x03f624f6 -[_UINavigationParallaxTransition animateTransition:] + 1155
47 UIKit 0x040a93ae -[UINavigationController _startCustomTransition:] + 3446
48 UIKit 0x040b58f7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
49 UIKit 0x040b64e9 -[UINavigationController __viewWillLayoutSubviews] + 57
50 UIKit 0x041f70d1 -[UILayoutContainerView layoutSubviews] + 213
51 UIKit 0x03fde964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
52 libobjc.A.dylib 0x0564f82b -[NSObject performSelector:withObject:] + 70
53 QuartzCore 0x03dac45a -[CALayer layoutSublayers] + 148
54 QuartzCore 0x03da0244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
55 QuartzCore 0x03da00b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
56 QuartzCore 0x03d067fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
57 QuartzCore 0x03d07b85 _ZN2CA11Transaction6commitEv + 393
58 QuartzCore 0x03dc55b0 +[CATransaction flush] + 52
59 UIKit 0x03f6d9bb _UIApplicationHandleEventQueue + 13095
60 CoreFoundation 0x0581377f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
61 CoreFoundation 0x0581310b __CFRunLoopDoSources0 + 235
62 CoreFoundation 0x058301ae __CFRunLoopRun + 910
63 CoreFoundation 0x0582f9d3 CFRunLoopRunSpecific + 467
64 CoreFoundation 0x0582f7eb CFRunLoopRunInMode + 123
65 GraphicsServices 0x06b4f5ee GSEventRunModal + 192
66 GraphicsServices 0x06b4f42b GSEventRun + 104
67 UIKit 0x03f6ff9b UIApplicationMain + 1225
68 Pageonce 0x000db639 main + 73
69 libdyld.dylib 0x064fe6d9 start + 1
)
What is the issue?
Turns out these two lines caused the crash:
self.ninjaStarImage.layer.removeFromSuperlayer()
self.view.layer.addSublayer(self.ninjaStarImage.layer)
Moving them to viewDidLayoutSubviews solved the problem

Foundation -[NSConcreteMapTable assign:key:value:isNew:] Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS at

I have a crash that happens only in IOS 7, I cannot reproduce it but it happens a lot. Does some one have an answer or at least have any idea where the problem can be.
I've allready removed all the warnings regarding ios7 and the crash still occurs.
Log is attached.
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3b43c626 objc_msgSend + 5
1 Foundation 0x315a9681 -[NSConcreteMapTable assign:key:value:isNew:] + 68
2 Foundation 0x315a95fb -[NSConcreteMapTable setObject:forKey:] + 82
3 Foundation 0x315ecaf7 -[NSISEngine setRowWithHead:body:] + 30
4 Foundation 0x315ef5d1 -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:] + 388
5 Foundation 0x315ed325 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 236
6 Foundation 0x315efd9f -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 226
7 Foundation 0x315eb5fd -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 692
8 Foundation 0x315eb23b -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 286
9 Foundation 0x315e8f6d -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 232
10 Foundation 0x315f47ed -[NSLayoutConstraint _addToEngine:] + 28
11 UIKit 0x33591c55 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 332
12 Foundation 0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
13 UIKit 0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
14 UIKit 0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
15 UIKit 0x33591bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
16 Foundation 0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
17 UIKit 0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
18 UIKit 0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
19 UIKit 0x33591bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
20 Foundation 0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
21 UIKit 0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
22 UIKit 0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
23 UIKit 0x33591bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
24 Foundation 0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
25 UIKit 0x33591ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
26 UIKit 0x3349e20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
27 UIKit 0x3349de33 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 82
28 Foundation 0x315e8b2b -[NSISEngine withBehaviors:performModifications:] + 210
29 UIKit 0x3349dcd3 -[UIView(Hierarchy) _postMovedFromSuperview:] + 298
30 UIKit 0x334aaa4f -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1414
31 UIKit 0x334aa4bf -[UIView(Hierarchy) addSubview:] + 30
32 UIKit 0x3358bdb7 -[UITransitionView transition:fromView:toView:removeFromView:] + 978
33 UIKit 0x335cbf3f -[UITransitionView transition:fromView:toView:] + 30
34 UIKit 0x335cbf15 -[UITransitionView transition:toView:] + 104
35 UIKit 0x335cb03b -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 1106
36 UIKit 0x335cabdf -[UITabBarController transitionFromViewController:toViewController:] + 38
37 UIKit 0x335caab7 -[UITabBarController _setSelectedViewController:] + 258
38 UIKit 0x33694dd5 -[UITabBarController _tabBarItemClicked:] + 272
39 UIKit 0x334d4037 -[UIApplication sendAction:to:from:forEvent:] + 90
40 UIKit 0x334d3fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
41 UIKit 0x33694c8b -[UITabBar _sendAction:withEvent:] + 370
42 UIKit 0x334d4037 -[UIApplication sendAction:to:from:forEvent:] + 90
43 UIKit 0x334d3fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
44 UIKit 0x334d3fb1 -[UIControl sendAction:to:forEvent:] + 44
45 UIKit 0x334bf717 -[UIControl _sendActionsForEvents:withEvent:] + 374
46 UIKit 0x336949ab -[UITabBar(Static) _buttonUp:] + 118
47 UIKit 0x334d4037 -[UIApplication sendAction:to:from:forEvent:] + 90
48 UIKit 0x334d3fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
49 UIKit 0x334d3fb1 -[UIControl sendAction:to:forEvent:] + 44
50 UIKit 0x334bf717 -[UIControl _sendActionsForEvents:withEvent:] + 374
51 UIKit 0x334d3a2f -[UIControl touchesEnded:withEvent:] + 590
52 UIKit 0x334d3701 -[UIWindow _sendTouchesForEvent:] + 528
53 UIKit 0x334ce6cb -[UIWindow sendEvent:] + 758
54 UIKit 0x334a38cd -[UIApplication sendEvent:] + 196
55 UIKit 0x334a1f77 _UIApplicationHandleEventQueue + 7102
56 CoreFoundation 0x30c4d20b __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
57 CoreFoundation 0x30c4c6db __CFRunLoopDoSources0 + 206
58 CoreFoundation 0x30c4aecf __CFRunLoopRun + 622
59 CoreFoundation 0x30bb5ebf CFRunLoopRunSpecific + 522
60 CoreFoundation 0x30bb5ca3 CFRunLoopRunInMode + 106
61 GraphicsServices 0x35abb663 GSEventRunModal + 138
62 UIKit 0x3350214d UIApplicationMain + 1136
I get the same issue. The strange thing is it only occurs in 3.5inch devices (ip4, ip4S), os7.x. works fine on ip5.
UPDATE: our team found the root cause. It's because we use this animation in code.
[UIView animateWithDuration:0.4f delay:0 usingSpringWithDamping:0.5f initialSpringVelocity:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
self.transform = CGAffineTransformMakeScale(sx,sy);
} completion:^(BOOL finished) {
self.hidden = !visible;
}];
to fix the bug, we avoid to run the animation if iOS <8.0
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) {
[UIView animateWithDuration:0.4f delay:0 usingSpringWithDamping:0.5f initialSpringVelocity:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
self.transform = CGAffineTransformMakeScale(sx,sy);
} completion:^(BOOL finished) {
if (finished) {
self.hidden = !visible;
}
}];
} else {
self.transform = CGAffineTransformMakeScale(sx,sy);
self.hidden = !visible;
}
Hope this help!
Thanks for who ever responded.
I solved it by removing the keyboard (resignFirstResponder) before poping the view controller.
In that screen I had 2 textfields that one of them was connected to the keyboard(inpuAccessoryView)and the other just activated the first one (I was developing a chat), when poping the view controller something probably went wrong.
Hope this will help someone.
I had a similar crash, except it happened when I did removeFromSuperview on a UIView that was created while inside a network callback. [NSISEngine withBehaviors:performModifications:] was where it started to go wrong after removeFromSuperview
eg. inside handleReadStreamEvent
if (!CFReadStreamSetClient( inputStream, kCFStreamEventHasBytesAvailable | kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered | kCFStreamEventOpenCompleted
, handleReadStreamEvent, &context ) )
It seems any view that was created while inside this callback, crashed when it was removed from the superview - most of the time.
I ended up using this whenever I was making any UIView changes when inside the callback.
- (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;
The same happened when inside a looptimer callback
CFRunLoopAddTimer( CFRunLoopGetMain(), timeoutTimer, kCFRunLoopCommonModes);

Crash on iOS 7: [NSConcreteMapTable assign:key:value:isNew:]

I get the next line on the crash log:
[NSConcreteMapTable assign:key:value:isNew:]
This crash happens on iOS 7, but not on iOS 8.
Somewhere before this line there are calls for NSLayoutConstraint:
-[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:]
-[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:]
-[NSLayoutConstraint _addToEngine:]
Do you guys think this crash has something to do with the Storyboard layout constraint I have set?
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3b46d626 objc_msgSend + 5
1 Foundation 0x315da681 -[NSConcreteMapTable assign:key:value:isNew:] + 68
2 Foundation 0x315da5fb -[NSConcreteMapTable setObject:forKey:] + 82
3 Foundation 0x3161daf7 -[NSISEngine setRowWithHead:body:] + 30
4 Foundation 0x316205d1 -[NSISEngine pivotToMakeBodyVar:newHeadOfRowWithHead:andDropRow:] + 388
5 Foundation 0x3161e325 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 236
6 Foundation 0x31620d9f -[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:rowBody:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 226
7 Foundation 0x3161c5fd -[NSISEngine tryToAddConstraintWithMarker:expression:integralizationAdjustment:mutuallyExclusiveConstraints:] + 692
8 Foundation 0x3161c23b -[NSLayoutConstraint _addLoweredExpression:toEngine:integralizationAdjustment:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 286
9 Foundation 0x31619f6d -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 232
10 Foundation 0x316257ed -[NSLayoutConstraint _addToEngine:] + 28
11 UIKit 0x335c2c55 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 332
12 Foundation 0x31619b2b -[NSISEngine withBehaviors:performModifications:] + 210
13 UIKit 0x335c2ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
14 UIKit 0x334cf20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
15 UIKit 0x335c2bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
16 Foundation 0x31619b2b -[NSISEngine withBehaviors:performModifications:] + 210
17 UIKit 0x335c2ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
18 UIKit 0x334cf20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
19 UIKit 0x335c2bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
20 Foundation 0x31619b2b -[NSISEngine withBehaviors:performModifications:] + 210
21 UIKit 0x335c2ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
22 UIKit 0x334cf20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
23 UIKit 0x335c2bbb __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 178
24 Foundation 0x31619b2b -[NSISEngine withBehaviors:performModifications:] + 210
25 UIKit 0x335c2ad9 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 336
26 UIKit 0x334cf20d -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 200
27 UIKit 0x334cee33 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 82
28 Foundation 0x31619b2b -[NSISEngine withBehaviors:performModifications:] + 210
29 UIKit 0x334cecd3 -[UIView(Hierarchy) _postMovedFromSuperview:] + 298
30 UIKit 0x334dba4f -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1414
31 UIKit 0x334db4bf -[UIView(Hierarchy) addSubview:] + 30
32 UIKit 0x335bcdb7 -[UITransitionView transition:fromView:toView:removeFromView:] + 978
33 UIKit 0x335fcf3f -[UITransitionView transition:fromView:toView:] + 30
34 UIKit 0x335fcf15 -[UITransitionView transition:toView:] + 104
35 UIKit 0x335fc03b -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 1106
36 UIKit 0x335fbbdf -[UITabBarController transitionFromViewController:toViewController:] + 38
37 UIKit 0x335fbab7 -[UITabBarController _setSelectedViewController:] + 258
38 UIKit 0x336c5dd5 -[UITabBarController _tabBarItemClicked:] + 272
39 UIKit 0x33505037 -[UIApplication sendAction:to:from:forEvent:] + 90
40 UIKit 0x33504fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
41 UIKit 0x336c5c8b -[UITabBar _sendAction:withEvent:] + 370
42 UIKit 0x33505037 -[UIApplication sendAction:to:from:forEvent:] + 90
43 UIKit 0x33504fd7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
44 UIKit 0x33504fb1 -[UIControl sendAction:to:forEvent:] + 44
45 UIKit 0x334f0717 -[UIControl _sendActionsForEvents:withEvent:] + 374
46 Foundation 0x31693163 __NSFireDelayedPerform + 414
47 CoreFoundation 0x30c7e167 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
48 CoreFoundation 0x30c7dd7f __CFRunLoopDoTimer + 782
49 CoreFoundation 0x30c7c11b __CFRunLoopRun + 1210
50 CoreFoundation 0x30be6ebf CFRunLoopRunSpecific + 522
51 CoreFoundation 0x30be6ca3 CFRunLoopRunInMode + 106
52 GraphicsServices 0x35aec663 GSEventRunModal + 138
53 UIKit 0x3353314d UIApplicationMain + 1136
seems like your using iOS 8 only constraints go to the storyboard open it on the top left corner you will see a little yellow icon with reading mark on it press on it and search for iOS8 only warnings, if you find any remove those constraints and rebuild your application.

Crash with UITabBarController

Sometimes I have strange crash when I switch from one tab to another:
0 libobjc.A.dylib 0x3857e636 objc_msgSend + 22
1 UIKit 0x3024ca89 -[UIResponder(Internal) _canBecomeFirstResponder] + 21
2 UIKit 0x3024c7a3 -[UIResponder becomeFirstResponder] + 207
3 UIKit 0x3024caff -[UIView(Hierarchy) becomeFirstResponder] + 107
4 UIKit 0x302c946b -[UITextField becomeFirstResponder] + 47
5 UIKit 0x302ca345 -[UIView(Hierarchy) deferredBecomeFirstResponder] + 57
6 UIKit 0x301cd441 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 165
7 Foundation 0x2e304d33 -[NSISEngine withBehaviors:performModifications:] + 211
8 UIKit 0x301cd291 -[UIView(Hierarchy) _postMovedFromSuperview:] + 297
9 UIKit 0x301da01d -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1413
10 UIKit 0x301d9a93 -[UIView(Hierarchy) addSubview:] + 31
11 UIKit 0x302bb563 -[UITransitionView transition:fromView:toView:removeFromView:] + 979
12 UIKit 0x302fb783 -[UITransitionView transition:fromView:toView:] + 31
13 UIKit 0x302fb759 -[UITransitionView transition:toView:] + 105
14 UIKit 0x302fa87b -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 1107
15 UIKit 0x302fa41f -[UITabBarController transitionFromViewController:toViewController:] + 39
16 UIKit 0x302fa2f7 -[UITabBarController _setSelectedViewController:] + 259
17 UIKit 0x303c45c9 -[UITabBarController _tabBarItemClicked:] + 273
18 UIKit 0x302036c7 -[UIApplication sendAction:to:from:forEvent:] + 91
19 UIKit 0x30203663 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 39
20 UIKit 0x303c447f -[UITabBar _sendAction:withEvent:] + 371
21 UIKit 0x302036c7 -[UIApplication sendAction:to:from:forEvent:] + 91
22 UIKit 0x30203663 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 39
23 UIKit 0x30203633 -[UIControl sendAction:to:forEvent:] + 47
24 UIKit 0x301eed7b -[UIControl _sendActionsForEvents:withEvent:] + 375
25 UIKit 0x303c41a7 -[UITabBar(Static) _buttonUp:] + 119
26 UIKit 0x302036c7 -[UIApplication sendAction:to:from:forEvent:] + 91
27 UIKit 0x30203663 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 39
28 UIKit 0x30203633 -[UIControl sendAction:to:forEvent:] + 47
29 UIKit 0x301eed7b -[UIControl _sendActionsForEvents:withEvent:] + 375
30 UIKit 0x3020307b -[UIControl touchesEnded:withEvent:] + 595
31 UIKit 0x30202d4d -[UIWindow _sendTouchesForEvent:] + 529
32 UIKit 0x301fdca7 -[UIWindow sendEvent:] + 759
33 UIKit 0x301d2e75 -[UIApplication sendEvent:] + 197
34 UIKit 0x301d1541 _UIApplicationHandleEventQueue + 7121
Maybe for someone this will look familiar and he could help to understand root of problem.
I got the same crash log.And my reason is the view controller is released but the UITextField.delegate is not setting nil. So you can set UITextField.delegate = nil in dealloc of the view controller.

Resources