美文网首页
UITableView删除一行报错

UITableView删除一行报错

作者: c42b9af86268 | 来源:发表于2016-11-21 15:28 被阅读0次

nvalid update: invalid number of rows in section 0.

由于TableView中的行数和数组中的不一致造成的,

NSIndexPath *index = [NSIndexPath indexPathForRow:indexPath inSection:0];

[self.modelArray removeObjectAtIndex:indexPath];

[self.tableView deleteRowsAtIndexPaths:@[index] withRowAnimation:UITableViewRowAnimationBottom];

相关文章

网友评论

      本文标题:UITableView删除一行报错

      本文链接:https://www.haomeiwen.com/subject/vuolpttx.html