是 - [UITableView reloadData]异步还是同步? [英] Is -[UITableView reloadData] asynchronous or synchronous?

查看:1341
本文介绍了是 - [UITableView reloadData]异步还是同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在表视图实例上调用 -reloadData 时,是否使所有 UITableViewDataSource 调用async?
谢谢。

When you call -reloadData on a table view instance, does it make all UITableViewDataSource calls async? Thank you.

推荐答案

此方法实际上只是删除所有 UITableViewCell 从表中查看。

This method actually just removes all the UITableViewCell views from the table. The data source delegate methods are called when the table is repainted.

因此,它是异步的。

编辑:

实际上,一些呼叫是同步的。段数目行和行高立即更新,因此,例如 contentSize 在调用后正确设置。另一方面, tableView:cellForRowAtIndex:在重绘之前不会被调用。

Actually, some calls ARE synchronous. The number of sections & rows and row heights are updated immediately, so, for example contentSize is set correctly after the call. On the other hand, tableView:cellForRowAtIndex: is not called until the table is repainted.

这篇关于是 - [UITableView reloadData]异步还是同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆