Lazy loading of a uitableView?
I have a Navigation Controller. When user taps a button a new UIViewCon开发者_C百科troller is pushed into the stack. This new view retrieves some information from a google api and shows it in a tableview. My problem is that the tableview isn't showing. I retrieve the info once the view has loaded so I can show an activity indicator.
- (void)viewDidAppear:(BOOL)animated
{
centersNames = [[NSMutableArray alloc] init];
placesFromXml = [[NSMutableArray alloc] init];
vicinity = [[NSMutableArray alloc] init];
[self ParseXML_of_Google_PlacesAPI];
[self.tableview reloadData]; //Doesn't work
[super viewDidAppear:animated];
}
How can I make the tableview appear after loading the info?
Thanks in advance and sorry for my English.
Finally I got the solution. The problem was the navigation controller wasn't calling viewWillAppear, etc. Solution found here:
http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
精彩评论