解决 Assertion failure in -[UITableView _endCellAnimationsWithContext:] 问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jjjjjj123321/article/details/76067796

找了几种方法

1,

[_tableView beginUpdates];  
[_tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];  
[_tableView endUpdates];  
在delete之前和之后加上beginUpdates和endUpdate

事实证明对我没什么用!

2,

在删除之前先删除掉数据源中的数据

[self.datas removeObject:self.datas[indexPath.row]];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationBottom];
ok了!

就是在调用deleteRowsAtIndexPaths:方法前,要确保数据为最新

扫描二维码关注公众号,回复: 4422036 查看本文章




猜你喜欢

转载自blog.csdn.net/jjjjjj123321/article/details/76067796
今日推荐