Question

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)...

Was it helpful?

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.

OTHER TIPS

UITABLEVIEW *mytableview=[[UITABLEVIEW alloc]init];
[mytableview reloadData];

Yes you are right; the UITABLEVIEW delegates are called before the web service. So you have to call those delegates again so try reloading the data. Works perfect for me. reload table when u have something returned from the webservice. store it in NSArray or whatever and then reload table.

Check out Apple's SeismicXML code example on the developer.apple.com/iphone site. It shows how to use NSURL, NSXMLParser, and a TableView to do just this type of thing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top