您的位置:首页 > 移动开发 > Objective-C

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

2017-07-25 14:22 696 查看
找了几种方法

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:方法前,要确保数据为最新
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios uitableview
相关文章推荐