记录一次iOS8 crash

tableView.delegate = vc;

vc 实现了 scrollViewDidScroll: 方法

vc.automaticallyAdjustsScrollViewInsets = YES

滑动tableView到最底, pop 出 vc

vc.dealloc 调用 释放

tableView removeFromSuperview 调用

这时 tableView.delegate != nil 而且会调用delegate.scrollViewDidScroll方法

造成野指针crash

我的解决办法

- (void)np_removeFromSuperview {

        self.delegate = nil;

        [self np_removeFromSuperview];

}

你可能感兴趣的:(记录一次iOS8 crash)