I have UISplitViewController, that displays a UITableView in the master view, and also in the detail view.
When the user selects an item in the master view table, I reload the table in the detail view, and I would like to animate this with a page curl up.
Here's the code I'm using:
UITableView *newTableView = [[UITableView alloc] initWithFrame:self.tableView.frame style:UITableViewStylePlain];
[newTableView reloadData]; // ineffective attempt to load data prior to transition
[UIView transitionFromView:self.tableView
toView:newTableView
duration:0.8
options:UIViewAnimationOptionTransitionCurlUp
completion:^(BOOL finished)
{
[newTableView reloadData]; // needed
[self setTableView:newTableView];
[newTableView release];
}];
The transition occurs, but the 'revealed' UITableView is just a plain unpopulated UITableView, unless I force a reload of the data in the completion block. Then, if I do that, I get the transition to an empty table, followed by a reload to show the intended data - not very nice.
How can I make it so that the table that is revealed already shows the required data? Thanks.