报错信息如下

原因是没有先remove数据就调用deleteRowsAtIndexPaths方法
[self deleteRowsAtIndexPaths:@[delectIndexPath] withRowAnimation:UITableViewRowAnimationFade];
[self.dataArray removeObjectAtIndex:indexPath.row];
所以报错.
修改后代码为
NSIndexPath *delectIndexPath =[NSIndexPath indexPathForRow:indexPath.row inSection:0];
[self deleteRowsAtIndexPaths:@[delectIndexPath] withRowAnimation:UITableViewRowAnimationFade];
[self.dataArray removeObjectAtIndex:indexPath.row];
网友评论