找了几种方法
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:方法前,要确保数据为最新