テーブルビューがあり、ユーザーが行を押すたびに別のクラスビューが表示されます。だから私は移行の間にローディングインジケータを持っていたかったのです。 MBProgressHUDを使用していますが、行を押したときに何も表示されませんでした。そして、私は@selector()の中に何を置くべきですか?MBProgressHUDアクティビティインジケータの使用
[読み上げshowWhileExecuting:@selector()onTarget:self withObject:[NSNumber numberWithInt:i] animated:YES];
ここに私のコードです。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
loading = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:loading];
loading.delegate = self;
loading.labelText = @"Loading Events, Please Wait..";
[loading showWhileExecuting:@selector(//what should I put) onTarget:self withObject:nil animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([[self.citiesArray objectAtIndex:indexPath.row] isEqual:@"NEW YORK"])
{
self.newYorkViewController = [[NewYorkViewController alloc] initWithNibName:@"NewYorkViewController" bundle:nil];
Twangoo_AppAppDelegate *delegate = (Twangoo_AppAppDelegate*)[[UIApplication sharedApplication] delegate];
[delegate.citiesNavController pushViewController:self.newYorkViewController animated:YES];
}
}
ありがとうございますが、私は待っている関数は、MBProgressHUDであるdidSelectRowAtIndexPathだと思います。 – kevin
いいえ、HUDが表示されている間、HUDが画面から削除されてから戻ると、待機機能が実行されます。 –
私はちょうど待っている方法で(真){}(継続的にループ)していると思います。プッシュ・サブビュー・コールの後にhudWasHiddenを配置します。 – kevin