Hi,
I have tabbar app where the second tab has a tableViewController.
When on the first tab i select the second tab the tableview shows up and all data is loaded.
The problem is, that the data is from the network and it takes 2-3 seconds to load. Until the data is loaded the UI of the tableview is not showen until all data is loaded.
How can i show the second tab with no data in the tableview and then reload the table data?
I've tried to use -viewWillAppear and -viewDidAppear but the UI is not showen until they both completely finish.
This is what i've tried
Teo
I have tabbar app where the second tab has a tableViewController.
When on the first tab i select the second tab the tableview shows up and all data is loaded.
The problem is, that the data is from the network and it takes 2-3 seconds to load. Until the data is loaded the UI of the tableview is not showen until all data is loaded.
How can i show the second tab with no data in the tableview and then reload the table data?
I've tried to use -viewWillAppear and -viewDidAppear but the UI is not showen until they both completely finish.
This is what i've tried
Code:
- (void)viewWillAppear:(BOOL)animated {
dataArray = [[NSArray alloc] initWithObjects:@"", nil];
[self.tableView reloadData];
[super viewWillAppear:animated];
}
- (void)viewDidAppear:(BOOL)animated {
[self loadData]; //This will load the actual data into dataArray
[self.tableView reloadData];
[super viewDidAppear:animated];
}
Teo