I am using a table view controller that makes a call to a web service and then parses the XML and display it in the table view. The problem is that the first time that I load it the XML apparently is not finished parsing before the view is shown. How can I reload the view after the XML is done parsing?
A:
Call the table view's reloadData method when the parsing has completed.
Mike Howard
2010-06-10 22:51:37
A:
After parsing is done, call tableview reloadData
- (void)parserDidEndDocument:(NSXMLParser *)parser {
[mytable reloadData];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [datas count];
}
Make sure that you update the mutable array "datas" value after parsing, such as datas will have the parsed 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.
Warrior
2010-06-10 23:17:30
Thanks that did the trick.
2010-06-12 21:00:27
Welcome to stackoverflow
Warrior
2010-06-14 16:12:03