开发者

Must I call -reloadRowsAtIndexPaths:withRowAnimation: inside an -beginUptades -endUpdates block?

Must I call -reloadRowsAtIndexPaths:withRowAni开发者_如何学Gomation: inside an -beginUptades -endUpdates block?


It depends what you are trying to do.

You should use beginUpdates/endUpdates for "subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously" (from UITableView beginUpdates)

However, if all you need to do is update the value of something in a cell you don't need the -reloadRowsAtIndexPaths call to be inside a beginUpdates/endUpdates. You can actually just grab the cell directly and update the value in a lot of cases.

See UITableView -reloadRowsAtIndexPaths for more specifics

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜