【发布时间】:2009-05-27 10:48:32
【问题描述】:
这是我想出的:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:1]; // my table view has 2 sections
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationTop];
每次构建和运行时,它都会抛出以下异常:
无效更新:第 0 节中的行数无效。更新后现有节中包含的行数必须等于更新前该节中包含的行数,加上或减去添加的行数或从该部分中删除。
这有点令人困惑。该部分设置为 1,但异常显示为 0。
【问题讨论】:
-
喜欢你的行 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:1];。为你 +1 ;)
标签: iphone objective-c cocoa-touch uitableview