我必须在 -beginUptades -endUpdates block 内调用 -reloadRowsAtIndexPaths:withRowAnimation: 吗?
最佳答案
这取决于您想要做什么。
您应该使用 beginUpdates/endUpdates 来“同时进行后续插入、删除和选择操作(例如 cellForRowAtIndexPath: 和 indexPathsForVisibleRows)”(来自 UITableView beginUpdates )
但是,如果您所需要做的只是更新单元格中某些内容的值,则不需要在 beginUpdates/endUpdates 内调用 -reloadRowsAtIndexPaths。 实际上,在很多情况下,您可以直接抓取单元格并更新值。
关于iphone - 我必须调用 -reloadRowsAtIndexPaths :withRowAnimation: inside an -beginUptades -endUpdates block?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2636457/