views:

60

answers:

1

I try to figure out what -beginUpdates and -endUpdates is actually good for.

Adding and deleting rows should go inside this. But what else? When must I do it? And when is it a good idea to do it even if I don't have to?

+3  A: 

From the docs for UITableView beingUpdates:

Begin a series of method calls that insert, delete, select, or delete rows and sections of the receiver.

and:

Call this method if you want subsequent insertions, deletion, and selection operations ... to be animated simultaneously

To me, that answers your question precisely.

Paul Lynch
well, for example, what if I change the height of a row. Isn't that an update to? For me that explanation looks like an incomplete list. It feels like if they just mentioned "some" things, but not all. The term "update" is pretty generic.
dontWatchMyProfile
Not really - the list is of actions that change the tableView structure. Contents of cells aren't included, and that would go for height, too. You shouldn't call reloadData from inside this block because it would possibly cause a race condition.
Paul Lynch