uitableview を持つ uipopovercontroller があり、uitableview メソッドの didselectrowatindexpath メソッドで uiactivityindicatorview のアニメーション化を開始したいと考えています。これが私のコードです。
-(IBAction)btnA_Clicked:(id)sender{
self.objuiviewCon = [[myuiviewController alloc] initWithNibName:@"myuiviewController" bundle:nil];
[self.objuiviewCon setDelegate:self];
self.ObjApopCon = [[UIPopoverController alloc] initWithContentViewController:self.objuiviewCon];
[self.ObjApopCon setPopoverContentSize:CGSizeMake(self.objuiviewCon.view.frame.size.width, self.objuiviewCon.view.frame.size.height)];
[self.ObjApopCon presentPopoverFromBarButtonItem:btnA permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
@interface myuiviewController : UIViewController<UITableViewDelegate,UITableViewDataSource>{
IBOutlet UITableView *tblList;
IBOutlet UIActivityIndicatorView *actiIndi;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [myarr count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
NSLog(@"cell called");
cell.textLabel.text = [myarr objectAtIndex:indexPath.row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"didSelectRowAtIndexPath called");
[actiIndi startAnimating];
}
インターフェイスビルダーとデリゲートで接続されているすべての iboutle も設定されます。しかし、私の問題は、didSelectRowAtIndexPath メソッドが呼び出されていますが、アクティビティインジケーターがアニメーション化されていないことです。
プロトコルを使用してテーブル ビューの行をクリックすると webservice を呼び出すので、webservice の出力を取得するまで uiactivityindicatorview をアニメーション化する必要があります。
任意の提案をいただければ幸いです。