tableView.delegate = vc;
vc 實(shí)現(xiàn)了 scrollViewDidScroll: 方法
vc.automaticallyAdjustsScrollViewInsets = YES
滑動tableView到最底矮冬, pop 出 vc
vc.dealloc 調(diào)用 釋放
tableView removeFromSuperview 調(diào)用
這時(shí) tableView.delegate != nil 而且會調(diào)用delegate.scrollViewDidScroll方法
造成野指針crash
我的解決辦法
- (void)np_removeFromSuperview {
? ? ? ? self.delegate = nil;
? ? ? ? [self np_removeFromSuperview];
}