重新加载视图控制器上的数据关闭 [英] Reload Data On View Controller Dismiss
问题描述
什么是在关闭配置视图后,最好的方法来重新加载该远程数据。我尝试了一些方法,包括使用委托来发送信息,并且仅在视图中加载数据将会出现,但希望知道最安全和最有效的方法。
提前感谢!
你想加载它在视图加载,它大大简化了事情 - 加上它只有在用户想要的时候才会加载数据,从而在3g上保存他或她的潜在可能的数据。如果在3g。
当数据加载时,如果视图已经出现,那么您可以在视图的顶部显示加载视图,禁用用户交互,直到完成加载,然后将其从其超级视图中删除,并在将数据呈现给表视图时再次启用用户交互。这通常是我以前做过的,以及我将来如何看待这件事。
I have a table view, which populates data from the web. To add information to this list I have a configuration screen presented modally. When data is added successfully the configuration screen is dismissed, I would like the data in the table view to automatically reload from the web to reflect the newly added data.
What is the best way to go about reloading this remote data after the configuration view is dismissed. I have tried a number of approaches including using a delegate to send information back and loading the data only on view will appear but would like to know the safest and most efficient way of doing this.
Thanks in advance!
You want to load it on view loading, it greatly simplifies things—Plus, it only loads data when your user wants it, thus saving him or her potentially some data on their conceivably limited data plan if on 3g.
While the data is loading, if the view has appeared, then you can display a "loading" view on top of your view, disable user interaction until it's done loading, then remove it from its superview and enable user interaction again, while presenting the data to your table view. This is generally how I've done it in the past, and how I'd look at doing it in the future.
这篇关于重新加载视图控制器上的数据关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!