0

I have a ViewController that requires a lot of data to be generated, this takes 5 seconds.

So the user doesn't think they haven't pressed the loading Tab the view appears immediately as I have kept ViewDidLoad sparse and the calculating routines are in ViewDidAppear. But it still takes 5 seconds for the results to materialise.

What is the mechanism for incrementally updating a label?

4

1 回答 1

1

这是一个非常本地化的问题,实际上取决于您的代码是什么样的以及您喜欢做什么。

如果这是我的代码,我会使用计时器(用于可预测的定期更新)或委托方法来获取标签以定期更新。我可能还会在标签旁边显示一个 UIActivityIndi​​cator 视图,以显示它即将进行更新。

于 2013-07-03T08:46:58.260 回答