我更新我UITableView
用下面的代码:UITableViewDataSource方法没有得到所谓的
int index = [self.guests indexOfObject:_guests];
[[self tableView] beginUpdates];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationLeft];
[[self tableView] endUpdates];
但调用[[self tableView] endUpdates]
,它不是调用其数据源的方法之后。在添加行的情况下,它会调用它的数据源方法。我认为在删除的情况下,它不需要向其数据源请求任何东西,但是在添加一行的情况下,它需要询问它的数据源几乎所有有关添加像cellForRow,高度等等的新行的一切。我只是想确保它是正确的,如果deleteRowsAtIndexPaths
不调用它的任何数据源方法?
你是否有所有的细胞可以在同一时间吗? – 2013-05-08 10:03:45
你需要调用'[tableView reloadData];'endUpdates – 2013-05-08 10:07:44
after no reloadata,tableView不会调用它的委托方法?@AhmedZ。 – 2013-05-08 10:12:46