1

활동 표시기에서 공개로 다시 변경하는 방법 ?? 내가 didSelectRow 때 다음 뷰 컨트롤러에 대한 몇 가지 사진을로드하고 근무 있기 때문에pushViewController 후 UITableViewCell에서 활동 표시기에서 공개로 변경하는 방법

, 나는 활동 표시에 공개했다,하지만 난 공개로 다시 변경하려면 운이 그나마 :

문제입니다 pushViewController 이후. 나는 이미 2ndViewController에서 테이블을 다시로드하려고 시도했지만 추락했습니다.

이 didSelectRow 내 코드입니다 그래서 아무도이 문제에 대한 해결책 .. 사전에

감사 있습니다

-(void)threadStartAnimating:(id)data 
{ 


    [activityView startAnimating]; 

    [self.navigationController pushViewController:bdvController animated:YES]; 




} 

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 
    activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 
    [cell setAccessoryView:activityView]; 




    [NSThread detachNewThreadSelector:@selector(threadStartAnimating:) toTarget:self withObject:nil]; 





    // Navigation logic -- create and push a new view controller 
    if(bdvController == nil) 

     bdvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]]; 


    AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row]; 




    bdvController.appsRecord = appRecord; 
    bdvController.HeaderText.text = appRecord.appName; 
    bdvController.title = appRecord.artist; 
    [bdvController.tableView reloadData]; 


} 

답변

2

가장 좋은 방법은 accessoryView에 포인터 전무를 설정하는 것입니다 , 예 :

cell.accessoryView = nil; 
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; 
cell.selectionStyle = UITableViewCellSelectionStyleGray; 

내 코드에서 이러한 작업은 정상적으로 작동합니다.

관련 문제