UITableView删除一行报错

2016-11-21  本文已影响0人  c42b9af86268

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];

上一篇 下一篇

猜你喜欢

热点阅读