我看到点击表项后会立即推送到新viewController
的应用,然后在加载新视图时显示activityIndicator
。我知道如何将activityIndicator添加到ProfileViewController
,但是如何在单击项目后立即将表推送到新控制器而不是等待内容加载?
- (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];
}
任何帮助或指导都会很精彩。谢谢大家!
答案 0 :(得分:0)
在viewDidAppear之前,不要对新视图控制器进行操作。然后你启动异步的东西并且不阻塞主线程: