views:

394

answers:

3

hi

I am new to iphone development. numberOfRowsInSection method of UITableViewController executed before parsing the XML node so that this method return value as zero, but this method should be return value of number of rows with data.

please help me

thanks.

+1  A: 

After parsing of your XML data is finished call [myTable reloadData]; - it will force your UITableView to reload the data shown and thus all necessary methods (including numberOfRowsInSection) to get called.

Vladimir
Is it possible that he should do the reading of the XML somewhere else as well?
willcodejavaforfood
Really hard to say anything without seeing code/ knowing the program structure...
Vladimir
A: 

I've had a similar problem before, and it was because I was passing the array/dictionary to the controller from the appdelegate. Unfortunately, after the app delegate went out of scope, the array was lost.

Try doing an array copy,

NSArray data = [NSArray arrayWithArray: passedInArray];

Sorry, don't have my trusty macbook on me to check the code, but you get the drift.

pms1969
A: 

I solved this problem via made connection between tableView reference and file owner in interface builder.

Sivanathan