当我在单击 collectionview 单元后推送到我的详细 View Controller 时,加载详细 View Controller 需要一些时间。 MainViewController.m
-(void)collectionViewUICollectionView *)collectionView didSelectItemAtIndexPathNSIndexPath *)indexPath{
DetailViewController *objDetailViewController = [self.storyboard instantiateViewControllerWithIdentifier"DetailViewController"];
objDetailViewController.objProduct = [arrList objectAtIndex:indexPath.row];
[self.navigationController pushViewControllerbjDetailViewController animated:YES];
}
DetailViewConteroller.m
- (void)viewDidLoad {
[super viewDidLoad];
[self setInitialValues];
[self productDetailAPI];//WS CALL
}
API 调用是否在主线程上运行? 您应该在后台线程上进行网络调用,以免阻塞 UI 线程。
关于ios - 在推送到另一个 View Controller 时加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31721410/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |