如何识别应用崩溃的地方。我试过添加所有异常断点。我尝试搜索rangeOfCharacterFromSet,但是没有真正崩溃的地方。
2016-10-13 15:18:29.809 Dev[11794:809091] -[NSNull rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0x5dae398
2016-10-13 15:18:29.816 Dev[11794:809091] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0x5dae398'
*** First throw call stack:
(
0 CoreFoundation 0x05b81494 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0563be02 objc_exception_throw + 50
2 CoreFoundation 0x05b8b253 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x05ac089d ___forwarding___ + 1037
4 CoreFoundation 0x05ac046e _CF_forwarding_prep_0 + 14
5 UIKit 0x0357acc6 -[UILabel _contentInsetsFromFonts] + 147
6 UIKit 0x03907ecc -[_UILabelLayer updateContentInsets] + 131
7 UIKit 0x03907fa1 -[_UILabelLayer updateContentLayerSize] + 48
8 UIKit 0x03908158 -[_UILabelLayer layoutSublayers] + 35
9 QuartzCore 0x030398b6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388
10 QuartzCore 0x030485b0 -[CALayer(CALayerPrivate) layoutBelowIfNeeded] + 44
11 UIKit 0x03377ba4 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1258
12 UIKit 0x036aaa48 -[UITableViewCell _setFrame:skipLayout:] + 420
13 UIKit 0x036aa89f -[UITableViewCell setFrame:] + 63
14 UIKit 0x0343998d __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 4094
15 UIKit 0x0337ddb2 +[UIView(Animation) performWithoutAnimation:] + 82
16 UIKit 0x0337ddfb +[UIView(Animation) _performWithoutAnimation:] + 40
17 UIKit 0x0343897c -[UITableView _configureCellForDisplay:forIndexPath:] + 504
18 UIKit 0x0344596b -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 877
19 UIKit 0x03445a7d -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 90
20 UIKit 0x03415b32 -[UITableView _updateVisibleCellsNow:isRecursive:] + 3347
21 UIKit 0x03434416 __29-[UITableView layoutSubviews]_block_invoke + 52
22 UIKit 0x0344f6cc -[UITableView _performWithCachedTraitCollection:] + 88
23 UIKit 0x034342eb -[UITableView layoutSubviews] + 214
24 UIKit 0x0338a3d4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 810
25 libobjc.A.dylib 0x05650059 -[NSObject performSelector:withObject:] + 70
26 QuartzCore 0x03046096 -[CALayer layoutSublayers] + 144
27 QuartzCore 0x030398b6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 388
28 QuartzCore 0x0303971a _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
29 QuartzCore 0x0302bee7 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 317
30 QuartzCore 0x03060847 _ZN2CA11Transaction6commitEv + 561
31 QuartzCore 0x03061108 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
32 CoreFoundation 0x05a9375e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
33 CoreFoundation 0x05a936be __CFRunLoopDoObservers + 398
34 CoreFoundation 0x05a8903c __CFRunLoopRun + 1340
35 CoreFoundation 0x05a88846 CFRunLoopRunSpecific + 470
36 CoreFoundation 0x05a8865b CFRunLoopRunInMode + 123
37 GraphicsServices 0x07149664 GSEventRunModal + 192
38 GraphicsServices 0x071494a1 GSEventRun + 104
39 UIKit 0x032b9eb9 UIApplicationMain + 160
40 Dev 0x0015aaca main + 138
41 libdyld.dylib 0x06067a25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
最佳答案
Xcode不显示您的代码行,因为该堆栈跟踪中没有代码。所有框架都在系统框架中(从技术上讲,main()除外)。当您出于任何原因将不良数据传递给系统框架时,都会发生这种情况,在这种情况下,是将不良数据传递给UILabel-可能会粘贴NSNull
实例作为标签标题。发生这种情况的最常见原因是JSON解析出错(但是由于其他多种原因也可能发生)。
您需要针对意外值或意外结构强化数据处理代码。
关于ios - Xcode 7无法找到有关崩溃的行或方法的详细信息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40020887/