Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute a function just after the view loads, iphone

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.

like image 538
Nithin Avatar asked Feb 20 '26 04:02

Nithin


1 Answers

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.

like image 80
Zoran Simic Avatar answered Feb 22 '26 18:02

Zoran Simic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!