I am working on an iOS 5 app. I have a view controller that needs to display data as soon as its opened. The desired order of functionality is:
- Call a web service
- Wait for the reply from the web service (a delegate)
- Fill a data array
- Use the array to populate a list view
- Show the list view
I have all of the components in place but after the web service call is made, the program doesn’t wait for a reply (asynchronous call) and instead fills the list view with blanks since the data array is not quite ready.
So I need help with either (1) making the program wait until the delegate finishes filling the array and then populating the list view or (2) re-initializing the listview after the delegate has completed and re-populating the whole list view. If I move the list view (like a scroll down) I see the desired data because the view is re-initialized. So I know that I have all the components in place, I just need to make them work in the desired order.
If you mean “an UITableView instance” by list view, then let the web service finish loading, then refresh the table view:
Hope this helps.