I have a UITableViewController that when loaded gets data from a web-service and stores it locally 开发者_如何学编程in an NSMutableArray, once that is loaded I need to loop through that data to build my table cells.
I have all of the code for looping through my array working fine I just need to know how to fire my controller to rebuild the table so my it displays my data.
[self.tableView reloadData];
After saving the datas in mutatable array after calling webservices, call tableview reloadData
[self.tableView reloadData];
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [datas count];
}
Make sure that you update the mutable array "datas" value after storing content in mutable array, such as datas will have the web service contents.
Here is sample program of parsing and displaying the parsed content in table, you can refer it how they are reloading their table after parsing
All the best.
I ended up following the instructions here for creating a UITableViewDataSource class, works like a champ!
UITableViewDataSource simplified
精彩评论