非常奇怪!它适用于所有地方但在这里
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MyViewController* cliente = [[MyViewController alloc] initWithModeAndClientId:2 c:cid];
cliente.delegate = self;
UINavigationController *n = [[UINavigationController alloc] initWithRootViewController:cliente];
n.navigationBarHidden = NO;
[[n navigationBar] setBarStyle:UIBarStyleBlack];
[self presentViewController:n animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
如果我点击该行点击一下,MyViewController几秒钟后即可显示!如果我点击两次,它会迅速显示!在Profiler中,单击没有任何反应......我没有didDeselectRowAtIndexPath方法.
解决方案是在主线程上加载第二个控制器
dispatch_async(dispatch_get_main_queue(), ^{
// Code here
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1714 次 |
| 最近记录: |