0%

iOS解决过的问题汇总

关于断点 objc_exception_throw 问题分析

通过bt打印出堆栈信息
例如:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.3
frame #0: 0x00000002232679c0 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000223fabe10 CoreFoundation`-[NSException raise] + 12
frame #2: 0x0000000224a778fc Foundation`-[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 248
frame #3: 0x00000002249ebe1c Foundation`-[NSObject(NSKeyValueCoding) valueForKey:] + 260
frame #4: 0x0000000224a091a4 Foundation`-[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 256
frame #5: 0x00000002507d45ac UIKitCore`-[UINibKeyValuePair apply] + 72
frame #6: 0x0000000223f7be88 CoreFoundation`-[NSArray makeObjectsPerformSelector:] + 280
frame #7: 0x00000002507d3fec UIKitCore`-[UINib instantiateWithOwner:options:] + 1628
frame #8: 0x0000000250d1ef84 UIKitCore`-[UITableView _dequeueReusableViewOfType:withIdentifier:] + 592
frame #9: 0x000000010351f838 Gundam`-[UITableView(TestinUITableView) testin_DequeueReusableCellWithIdentifier:] + 112
frame #10: 0x0000000250d1f42c UIKitCore`-[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:] + 164
frame #11: 0x0000000250d1f358 UIKitCore`-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 96
frame #12: 0x000000010351f9b8 Gundam`-[UITableView(TestinUITableView) testin_DequeueReusableCellWithIdentifier:forIndexPath:] + 292
* frame #13: 0x000000010267cfe8 Gundam`-[DKLandlordEntrustViewController tableView:cellForRowAtIndexPath:](self=0x0000000155b0aa00, _cmd="tableView:cellForRowAtIndexPath:", tableView=0x000000015495fa00, indexPath=0xb59300120e671f5c) at DKLandlordEntrustViewController.m:220:33
frame #14: 0x0000000250d38618 UIKitCore`-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 680
frame #15: 0x0000000250d38b18 UIKitCore`-[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 80
frame #16: 0x0000000250d05320 UIKitCore`-[UITableView _updateVisibleCellsNow:isRecursive:] + 2260
frame #17: 0x0000000250d22640 UIKitCore`-[UITableView layoutSubviews] + 140
frame #18: 0x0000000250fb1170 UIKitCore`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1292
frame #19: 0x00000002285cbc60 QuartzCore`-[CALayer layoutSublayers] + 184
frame #20: 0x00000002285d0c08 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 332
frame #21: 0x00000002285333e4 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 348
frame #22: 0x0000000228561620 QuartzCore`CA::Transaction::commit() + 640
frame #23: 0x000000022856215c QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #24: 0x000000022401fd08 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
frame #25: 0x000000022401aa30 CoreFoundation`__CFRunLoopDoObservers + 412
frame #26: 0x000000022401afac CoreFoundation`__CFRunLoopRun + 1228
frame #27: 0x000000022401a7c0 CoreFoundation`CFRunLoopRunSpecific + 436
frame #28: 0x000000022621b79c GraphicsServices`GSEventRunModal + 104
frame #29: 0x0000000250b19c38 UIKitCore`UIApplicationMain + 212
frame #30: 0x00000001024cd140 Gundam`main(argc=1, argv=0x000000016dbc37f0) at main.m:15:16
frame #31: 0x0000000223ade8e0 libdyld.dylib`start + 4

然后通过单步调试,在汇编里面看到生成exception (creat)等等,最后定位到位置。

希望对您有所帮助,您的支持将是我莫大的动力!