开发者

In which situations must I put my code inside an -beginUpdates -endUpdates block, and when is it optional?

开发者 https://www.devze.com 2022-12-26 15:30 出处:网络
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 ide

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?


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.

0

精彩评论

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

关注公众号