I have seen apps that will push to the new viewController immediately upon clicking the table item, then display an activityIndicator while the new view is loading. I know how to add the activityIndicator to the ProfileViewController, but how do I make the table push to the new controller immediately upon clicking the item rather than waiting for the content to load?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
*)indexPath
{
ProfileViewController *profileViewController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
//profileViewController.title = [[news objectAtIndex:indexPath.row] objectForKey:@"name"];
profileViewController.newsArticle = [news objectAtIndex:indexPath.row];
[self.navigationController pushViewController:profileViewController animated:YES];
}
Any assistance or guidance would be wonderful. Thank you all!
You don’t to an operation on the new view controller until the viewDidAppear. And then you fire off something that is asynchronous and does not block the main thread: