Reputation: 987
I am building an ios app, that uses google places api to locate certain places and then display the details in a table view. But the problem, that I am facing is that
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
method gets called before the data acquired from the api is stored in the memory. So it (obviously) returns 0, and details are not displayed. Is there some way I can delay the call of Table View?
Upvotes: 0
Views: 98
Reputation: 8014
Well your only option is to not show the table view until there is data there.
Assuming this is not viable, why not just show an activity popup indicating that you are loading information and then when its loaded, drop the activity indicator and call [self.tableview reloadData]
;
Upvotes: 3
Reputation: 467
You can make the tableview invisible and make it visible right before reloading the table.
Upvotes: 0