iOS Crash解析

iOS日常记录

2016-12-03  本文已影响1178人  DreamBuddy

日常のBUG修复

libobjc.A.dylib
objc_msgSend + 16

1 UIKit
-[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 72

2 UIKit
-[UIScrollView setContentOffset:] + 500

3 UIKit
-[UITableView setContentOffset:] + 300

4 Foundation
__NSSetPointValueAndNotify + 152

5 UIKit
-[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 864

6 UIKit
-[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 400

7 UIKit
-[UIScrollView removeFromSuperview] + 44

8 UIKit
-[UIView dealloc] + 440

9 libobjc.A.dylib
(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564

10 CoreFoundation
_CFAutoreleasePoolPop + 28

11 CoreFoundation
___CFRunLoopRun + 1500

12 CoreFoundation
CFRunLoopRunSpecific + 396

13 GraphicsServices
GSEventRunModal + 168

14 UIKit
UIApplicationMain + 1488

15 OneLucky_Cn_LuckyBuy
main (main.m:14)

16 libdyld.dylib
_start + 4

经过无数次的百度,找到了几篇文章,崩溃的原因是 iOS8系统下 ViewController被 控制器pop出堆栈以后 ,tableView 已经被release掉,但是 代理方法 仍旧会试图调用 send 消息 到 它的delegate方法。
处理方法

- (void)dealloc{
    self.tableView.delegate = nil;
    self.tableView.dataSource = nil;
}
参考:
http://blog.csdn.net/justin555555/article/details/48261915
http://stackoverflow.com/questions/26103756/uiscrollview-internal-consistency-crash
http://stackoverflow.com/questions/15016348/set-delegates-to-nil-under-arc
上一篇下一篇

猜你喜欢

热点阅读