在viewController里面有一个TableView,tableView的Delegate方法里
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
而每次一拉出Cell的删除按钮的时候POP,程序必定闪退!这让人很蛋疼,错误如下
-[对象名 tableView:canEditRowAtIndexPath:]: message sent to deallocated instance 0x1770e430
后来在overflow上找到了解决办法:
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[table setEditing:NO];
}
但是不知道为什么!!!有同学知道为什么吗?!!!