我正在创建一个tabbar应用程序。 其中一个选项卡用于rss feed,这是一个导航应用程序。 但是当我单击tab tab按钮时,需要一段时间来加载该选项卡的视图。 这是因为应用程序正在等待从服务器加载订阅源。 有没有办法在加载该Feed之前加载视图。 截至目前,我正在viewDidLoad方法中提供请求。 这就是造成问题的原因。 我应该移动代码以便在单击标签栏按钮时立即加载视图。
I am creating a tabbar application. One of the tabs is for an rss feed, which is a navigation application. but when i click the tab bat button, it is taking a while to load the view of that tab. It is because the application is waiting for the feed to be loaded from the server. Is there any way to load the view before the loading of that feed takes place. As of now, i'm giving the request in the viewDidLoad method. Thats what is creating the problem. To which part shall i move the code so that the view is loaded instantaneously when clicking the tabbar button.
最满意答案
我在iCodeBlog上推荐这篇关于这个主题的精彩文章 ,这是一种非常优雅的方式。 如果您将RSS订阅源加载为NSOperation ,它将在后台很好地进行,而不会阻止您的主线程。
I recommend this great article on this subject on iCodeBlog, it's a very elegant way of doing this. If you submit your rss feed loading as an NSOperation, it will take place nicely in the background without blocking your main thread.
更多推荐
发布评论