テーブルビューがあり、ユーザーが行を押すたびに、別のクラスビューが表示されます。そのため、トランジションの間にローディング インジケーターが必要でした。MBProgressHUD を使用していますが、行を押しても何も表示されませんでした。@selector() の中に何を入れる必要がありますか?
[loading showWhileExecuting:@selector() onTarget:self withObject:[NSNumber numberWithInt:i] animation: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];
}
}