Should I call -reloadRowsAtIndexPaths: withRowAnimation: inside the -beginUptades -endUpdates block?

Should I call -reloadRowsAtIndexPaths: withRowAnimation: inside the -beginUptades -endUpdates block?

+2


a source to share


1 answer


It depends on what you are trying to do.

You should use beginUpdates / endUpdates for "subsequent insert, delete, and select operations (eg cellForRowAtIndexPath: and indexPathsForVisibleRows) to animate at the same time" (from UITableView beginUpdates )



However, if all you have to do is update the value of something in the cell, then you don't need to call -reloadRowsAtIndexPaths, which is inside startUpdates / endUpdates. In fact, you can just grab the cell directly and update it in many cases.

See more on UITableView -reloadRowsAtIndexPaths for more details

+3


a source







All Articles