我在我的应用程序中使用了master-detail示例。HUD在执行segue时显示
我添加了MBProgressHUD显示加载屏幕,而细节得到加载。
的事情是,我不知道我在做什么错误的线程,但我已经结束了2种方式做的:
1 - 如果我不扔dispatch_async()时,HUD是延迟显示;
2 - 如果我在dispatch_async()内部执行segue,则需要花费更多时间来加载内容。
下面有例如1 DA代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[HUD show:YES];
[self performSegueWithIdentifier:@"detail" sender:nil];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
下面有例如2 DA代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[HUD show:YES];
dispatch_queue_t taskQ = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
dispatch_async(taskQ, ^{
[self performSegueWithIdentifier:@"detail" sender:nil];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
});
}
任何引线?