What I have is an app with a UITableViewController, that is filled with custom UITableViewCells. I have some data available to feed the cells, however I need to download some extra content (pics, etc).
So what I do in the viewDidLoad method, I init a UITableViewCell object, fill all the labels with the info I have already available. Then I launch one of the cell class’s methods to download the data. After I’m done with the specific cell, I put it into a NSMutableArray and proceed with the next cell.
Then in the cellForRowAtIndexPath method I return the cell at the specific index from the mutable array.
What happens is that until all the data isn’t downloaded, my tableView is stuck… I’m not sure if this is the right approach, but I think I have to launch the method which downloads and then fills the extra content to the cell on another thread. How can I do that?
Thanks a lot in advance!
As suggested by rckoenes, using AFNetworking works! 🙂 I think for those of you still without ARC an alternative would be ASIHTTPRequest.
Here is my code for downloading the image: