我将如何在加载 tableView 时运行一些代码。这是我认为可能有效的方法:
while ([self.tableView reloadData]) {
do something
}
我希望在加载表时运行 UIActivityIndicator,然后在加载数据后消失。
谢谢你的帮助
最佳答案
如果您只想在加载表格时运行事件指示器:
[indicator startAnimating];
[self.tableView reloadData];
[indicator stopAnimating];
假设您有一个名为 indicator 的 UIActivityIndicator 并且其 hidesWhenStopped 属性设置为 YES。
如果您想做一些其他类型的工作,您很可能需要在单独的线程、调度队列等中完成这项工作。
关于ios - 我将如何在加载 tableView 时运行一些代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13586802/