私のアプリで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];
});
}
任意のリード?