Tuesday, August 24, 2010

How to load your data correctly in the background - iOS


Almost all view controllers need to load some data from the internet and interact with them.
This kind of task may sound simple at first, but as you will find out, there are some kind of complications, like autoreleasing objects with no autorelease pool in place, how to get notified when your data has been loaded and how to handle this data. Also all the updates to the view should be done in the main thread, not the background thread, to avoid possibly app crash.
To solve all these problems I’ve created a subclass of UiViewController that controls all the steps required to load the data the right way, and updates the view the right way.
Continue reading about this in my tumblr blog here

No comments:

Post a Comment