I have a UIViewController that contains a UITableView.
I’m trying to fill this table with data parsed from an XML file.
The first time the TableView loads the data isn’t available just yet.
What would be the best way to reload this view?
I tried to do a self.TableView reloadData after the parsing finished.
Unfortunately the NSMutableArray holding the parse result getting reset during reloadData.
The array is set at the UIVivewController.
Should I set the NSMutablearray as a global variable?
THanks a bunch
The array should be an ivar (instance variable) of the view controller containing the
UITableView. When you are done parsing the ivar should be populated with the data and you should be able to populate theUITableViewwith no problem using[self.TableView reloadData]. Make sure you are not removing all objects or re-initializing the array in any of the delegate or datasource callbacks.