开发者

iphone: "preload" a view (tab bar controller)

Basically my app loads two RSS feeds - a blog feed and a twitter stream. These are in two different views in a tab bar controller. There is also a Home view which is the default view when the application launches.

Ok, so basically when you go from the Home tab to the blog or twitter tab then it takes a while to load. Fair enough, its trying to download everything off the internet.

My question is, while the user is on the home page is there any way of "preloading" the other views so that the开发者_StackOverflow社区 viewDidAppear function is already run?

Or, maybe a way of having a "loading" screen, because at the moment it seems like the application has just crashed when you click on a tab, the tab doesn't even highlight until it has loaded the view.

Thanks a lot guys.


IMO it's not a good idea to preload the views themselves. But it might make sense to preload the data from the home screen (at least when you're connected to WiFi). To do that, decouple the loading code from the view, e.g. by moving it to a separate model class.

In general, you should implement all your network connections asynchronously to avoid freezing the UI during these operations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜