1

活動指標から開示に戻す方法は??

問題は:

SelectRow を実行したとき、次のビュー コントローラーの画像を読み込むため、アクティビティ インジケーターを開示しましたが、正常に機能しましたが、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];


}
4

1 に答える 1

2

最良の方法は、accessoryView にポインター nil を設定することです。例:

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

私のコードでは、これらの操作は正常に機能します。

于 2011-10-07T07:52:09.120 に答える