Search code examples
uitableviewnsurlconnectionnsmutableurlrequest

Populate UITableView with results of webservice


I have a table view which i want to populate with the results (XML) of my call to a web service.

The NSURLConnection and NSMutableURLRequest that are doing the setup for this are currently in my -viewDidLoad method, and i also have all of my UITableView delegate methods in my .m file too.

The data is being returned and added to my array correctly. My problem is (i think) that the UITableView methods are being called before any data has been returned from the web service, which is why my table view is always blank.

How can i call the methods in the right order (if this is even the problem)...


Solution

  • Are you calling reloadData on the tableview once you've repopulated the array? You need to let it know that you have new data.