iOS 8 动画执行过程当中返回 Crash

以前项目里一直有个iOS8 [UIScrollView(UIScrollViewInternal) _notifyDidScroll] crash的问题,存在了好久,后来复现问题,返现是动画执行过程当中执行pop 的问题
 
场景:在商品详情页加车以后  作了滑动到下面的商品推荐位置, 当动画尚未执行完毕, 就POP回上个页面,就会发生以下Crash
 
 
 
 
Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x195287bdc objc_msgSend + 28
1  UIKit                          0x18876fbbc -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 72
2  UIKit                          0x1884acdb4 -[UIScrollView setContentOffset:] + 500
3  UIKit                          0x188562a98 -[UITableView setContentOffset:] + 300
4  UIKit                          0x188646234 -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 316
5  QuartzCore                     0x187e2629c CA::Display::DisplayLinkItem::dispatch() + 32
6  QuartzCore                     0x187e26134 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 324
7  IOKit                          0x184c01470 IODispatchCalloutFromCFMessage + 376
8  CoreFoundation                 0x1839f2dc4 __CFMachPortPerform + 180
9  CoreFoundation                 0x183a07a54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
10 CoreFoundation                 0x183a079b4 __CFRunLoopDoSource1 + 436
11 CoreFoundation                 0x183a05934 __CFRunLoopRun + 1640
12 CoreFoundation                 0x1839312d4 CFRunLoopRunSpecific + 396
13 GraphicsServices               0x18d1476fc GSEventRunModal + 168
14 UIKit                          0x1884f6fac UIApplicationMain + 1488
15 ZZKKO                          0x100393c74 main (main.m:16)
16 libdyld.dylib                  0x1958f2a08 start + 4
 
 
缘由: iOS8系统下 ViewController被 控制器pop出堆栈之后 ,tableView 已经被release掉,可是 代理方法 仍旧会试图调用 send 消息 到 它的delegate方法。
 
 
解决办法  
- (void)dealloc {
    self.tableView.delegate = nil;
    self.tableView.dataSource = nil;
}
相关文章
相关标签/搜索