问题描述
我正在开发一个带有选项卡的应用程序,可以显示数据库中某个人的信息.在我的一个选项卡中有一个文本框,用户可以通过它搜索新人.
I working on an app with tabs which shows info about a person in a database. In one of my tabs there is a textbox through which a user can search for a new person.
我的问题是,如何使用新人的信息刷新我的所有选项卡?
My problem is, how do I refresh all my tabs with the information from the new person?
我进行了服务器调用并获取了所有新信息,但我只是不知道如何刷新整个应用程序.任何帮助将不胜感激.
I make a server call and get all the new info but I just don't know how to refresh the entire app. Any help would be appreciated.
谢谢
推荐答案
在旧数据失效时发布通知,并在新数据可用时发布通知.让你的视图控制器监听这些通知.当旧数据失效时,显示加载通知.当有新数据可用时,更新您的视图并清除所有加载通知.
Post a notification when old data is invalidated and post a notification when new data is available. Make your view controllers listen for these notifications. When old data is invalidated, show a loading notification. When new data is available, update your views and clear any loading notification.
这篇关于刷新整个 iOS 应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!