저는 uipopovercontroller를 가지고 있고, uitableview 메소드의 didselectrowatindexpath 메소드에서 uiactivityindicatorview에 애니메이션을 적용하려고합니다. 여기 내 코드가있다.uiactivityindicatorview가 uipopoverviewcontroller iphone에서 작동하지 않습니다.
-(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 메서드를 호출하고 있지만 activityindicator 애니메이션되지 않습니다.
나는 webservice를 호출 할 때 프로토콜을 사용하여 테이블 뷰 행을 클릭하므로 웹 서비스의 출력을 얻을 때까지 애니메이션에 uiactivityindicatorview가 필요합니다.
모든 의견을 환영합니다.
감사합니다. 코코아는 answering.it에 중요한 점은 tableview가 전면에 나타납니다. 그래서 행동은 표시되지 않습니다. –