如何从以下代码检测崩溃?

时间:2015-11-04 11:10:12

标签: ios debugging

我试图通过以下代码/代码段找到崩溃。

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                6771342288 objc_msgSend + 16
1  Foundation                     6488040888 vars_index_with_insert + 396
2  Foundation                     6488046624 -[NSISLinearExpression setCoefficient:forVariable:] + 372
3  Foundation                     6488038164 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 432
4  Foundation                     6488033112 -[NSLayoutConstraint _tryToChangeContainerGeometryWithUndoHandler:] + 136
5  Foundation                     6488032176 -[NSLayoutConstraint _setSymbolicConstant:constant:] + 420
6  UIKit                          6558145124 -[UIWindow(AdditionalLayoutSupport) _windowInternalConstraints_sizeDidChange] + 220
7  UIKit                          6553937808 -[UIWindow _setFrame:sendTraitNotifications:] + 436
8  UIKit                          6553925712 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke1072 + 264
9  UIKit                          6556461676 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 56
10 UIKit                          6551262980 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 508
11 UIKit                          6551360196 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 68
12 UIKit                          6556461540 -[_UIWindowRotationAnimationController animateTransition:] + 388
13 UIKit                          6553920912 -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 800
14 UIKit                          6553924620 -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1260
15 UIKit                          6553926412 -[UIWindow _setRotatableClient:toOrientation:applyTransformToWindow:updateStatusBar:duration:force:isRotating:] + 360
16 UIKit                          6551563312 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 144
17 UIKit                          6551529112 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 128
18 UIKit                          6551053184 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
19 UIKit                          6551051872 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 332
20 CoreFoundation                 6472590020 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
21 CoreFoundation                 6471791696 _CFXNotificationPost + 2060
22 Foundation                     6487714432 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
23 UIKit                          6551051060 -[UIDevice setOrientation:animated:] + 360
24 UIKit                          6551050224 -[UIApplication handleEvent:withNewEvent:] + 1632
25 UIKit                          6551048320 -[UIApplication sendEvent:] + 104
26 UIKit                          6551491268 _UIApplicationHandleEvent + 700
27 GraphicsServices               6633656724 _PurpleEventCallback + 712
28 GraphicsServices               6633655428 PurpleEventCallback + 44
29 CoreFoundation                 6472661588 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
30 CoreFoundation                 6472661428 __CFRunLoopDoSource1 + 436
31 CoreFoundation                 6472653108 __CFRunLoopRun + 1640
32 CoreFoundation                 6471783124 CFRunLoopRunSpecific + 396
33 GraphicsServices               6633649916 GSEventRunModal + 168
34 UIKit                          6551465792 UIApplicationMain + 1488
35 project_name                   4298267384 main + 108 (main.m:18)
36 libdyld.dylib                  6778251784 start + 4

1 个答案:

答案 0 :(得分:0)

转到" Breakpoint navigator"然后点击" +"左下角的按钮,然后选择"添加异常断点..."。

这种断点捕获所有异常,因此您可以在左侧导航堆栈错误并找出发生的情况。