开发者

TableView not displaying parsed data from xml?

i have tabbar controller, first tab is for Tableview controller.but i do xml parsing in appldidfinish method , in the xml parse didEndElement, i calculate items count and i give it into first tab'开发者_StackOverflow社区s Tableview controller's numberOfRowsInSection,but after xml parsing finished, the following method wont be called. tableview is empty....?

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{
   return [myParser.items count];
}

i have declared in view did load method of that table view controller

myParser = [[XMLMyParser alloc] init];

any help please.....


When the XML parsing is complete, you need to inform the table view that the data has changed. You do this by sending the reloadData message to your table view instance:

[myTableView reloadData];

Assuming you're using the NSXMLParser, you will need to add this in parserDidEndDocument message of your NSXMLParserDelegate implementation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜