I have seen many apps that load data to UITableViews from the internet, and they usually load smoothly. Now it’s my turn to load in that kind of data. I am getting different data at the same time, separating categories with ~ and pieces of categories with #. This works great, and I have managed to separate the data in obj-c perfectly.
Everything in my app works, it’s just that the loading takes a lot of time.
So, I guess the real question is, how can you load in data for a tableView in the background, showing a label/UIActivityView or something while it is loading?
Thank you.
The simplest way is to add a temporary cell which shows some kind of loading progress (label with ‘Loading…’ text, or a UIActivityIndicator, etc). When your data is done loading, remove that cell and add your actual cells with your data.
To load data ‘in the background’ I would recommend having a look at NSURLConnection. It lets you implicitly load the data asynchronously so you don’t have to deal with threads.