通常是cell初始化为结果返回nil导致闪退异常。
只要排查cell的初始化方法就可以了。但如果是多个类型的cell区分并且实例化时,一定要注意检查每个类型是否都包含在里面,我就是因为少了一个类型所以一直没发现问题,总认为自己初始化cell的方法没有问题。
细心、细心、细心。重要的事情说三遍。
017-01-06 16:56:12.948 VSTMALL[9971:225217] *** Assertion failure in -[VSTOrderDetailsTableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962
2017-01-06 16:56:13.009 VSTMALL[9971:225217] UMLOG: error: session_id=1C71ACC182677983147A2013A199D367, context=UITableView (<VSTOrderDetailsTableView: 0x7f8305145000; baseClass = UITableView; frame = (0 0; 320 460); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7f8306a78fe0>; layer = <CALayer: 0x7f8306a70c00>; contentOffset: {0, 0}; contentSize: {320, 248}>) failed to obtain a cell from its dataSource (<VSTOrderDetailsTableView: 0x7f8305145000; baseClass = UITableView; frame = (0 0; 320 460); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7f8306a78fe0>; layer = <CALayer: 0x7f8306a70c00>; contentOffset: {0, 0}; contentSize: {320, 248}>)
(null)
((
0 CoreFoundation 0x0000000109e91e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001098dedeb objc_exception_throw + 48
2 CoreFoundation 0x0000000109e91cca +[NSException raise:format:arguments:] + 106
3 Foundation 0x00000001069814de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x0000000107827049 -[UITableView _configureCellForDisplay:forIndexPath:] + 225
5 UIKit 0x0000000107832e6d -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 808
6 UIKit 0x0000000107832f7b -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
7 UIKit 0x0000000107807a39 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2996
8 UIKit 0x000000010783c01c -[UITableView _performWithCachedTraitCollection:] + 92
9 UIKit 0x0000000107822edc -[UITableView layoutSubviews] + 224
10 UIKit 0x00000001077904a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
11 QuartzCore 0x00000001097ba59a -[CALayer layoutSublayers] + 146
12 QuartzCore 0x00000001097aee70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
13 QuartzCore 0x00000001097aecee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
14 QuartzCore 0x00000001097a3475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
15 QuartzCore 0x00000001097d0c0a _ZN2CA11Transaction6commitEv + 486
16 QuartzCore 0x00000001097d137c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
17 CoreFoundation 0x0000000109dbd367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
18 CoreFoundation 0x0000000109dbd2d7 __CFRunLoopDoObservers + 391
19 CoreFoundation 0x0000000109db2f2b __CFRunLoopRun + 1147
20 CoreFoundation 0x0000000109db2828 CFRunLoopRunSpecific + 488
21 GraphicsServices 0x000000010caa2ad2 GSEventRunModal + 161
22 UIKit 0x00000001076d9610 UIApplicationMain + 171
23 VSTMALL 0x0000000104b6b73f main + 111
24 libdyld.dylib 0x000000010af5e92d start + 1
25 ??? 0x0000000000000001 0x0 + 1
)