MiAo的博客:http://blog.csdn.net/miao_em
今天开发时候遇到了用presentViewController 弹出延迟的问题,延迟大概有3秒左右,很影响用户体验,在网上找找答案
dispatch_async(dispatch_get_main_queue(), ^{
ContactsViewController *vc = [[ContactsViewController alloc]init];
UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:vc];
vc.tagForVC = 99;
[self presentViewController:nav animated:YES completion:nil];
});
将跳转语句用GCD写进主线程中,猜测可能不在主线程中修改了UI,所以会有延迟。