アプリでマスター/ディテールの例を使用しています。
そして、MBProgressHUDを追加して、詳細が読み込まれている間に読み込み画面を表示しました。
問題は、スレッドで何が間違っているのかわからないということですが、それを行うには2つの方法があります。
1 - dispatch_async() をスローしないと、HUD が遅延して表示されます。
2 - dispatch_async() 内でセグエを実行すると、読み込みに必要以上の時間がかかります。
例 1 のコードは次のとおりです。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[HUD show:YES];
[self performSegueWithIdentifier:@"detail" sender:nil];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
例 2 のコードは次のとおりです。
- (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];
});
}
手がかりはありますか?