UITableView删除行奔溃,Invalid update: invalid number of sections. The number of sections contained
UITableView删除行崩溃,解决方法,添加开始更新,结束更新,在更新期间删除数据保持数据匹配。
·
由于删除行是,数据未处理完成,导致tableview更新时,数据更行不及时导致冲突
具体实现方法:
//必须添加开始更新和结束更新,中间必须删除数据
//开始更新
[self.tableView beginUpdates];
//填入数据操作
[tableView deleteRow:indexPath.row inSection:indexPath.section withRowAnimation:UITableViewRowAnimationAutomatic];
[_arrayTableCellData removeObjectAtIndex:row];
//结束更新
[self.tableView endUpdates];
更多推荐
所有评论(0)