0

私はこれに数時間を費やし、さまざまなことを試みました。didSelectRowAtIndexPathが実際に実行されており、探している特定のオブジェクトが返されていることを確認できます。

何もしていない部分は、SensDetailViewClassビューを表示しようとしている部分です。コードは実行されますが、SensDetailViewClass.mのviewDidLoadメソッドは実行されず、ビューは変更されません。

SensDetailViewClassを表示させたいのですが。.xibファイルの所有者がSensDetailsViewClassであることを確認できます。

助けてください。これがコードです。

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

// get the selected item
Sens *info = [_sensInfos objectAtIndex:indexPath.row];

// initialise the detail view controller and display it
SensDetailViewClass *details = [[SensDetailViewClass alloc] initWithNibName:@"MainWindow" bundle:nil];

// set the title of the page
[details setTitle:info.heading];

details.selectedSens = info;

[self.navigationController pushViewController:details animated:YES];
[details release];

}

更新:次のメカニズムを使用して動作させることができました:[self presentModalViewController:detailsアニメーション:YES];

4

3 に答える 3

0
SensDetailViewClass *details = [[SensDetailViewClass alloc] initWithNibName:@"SensDetailViewClass" bundle:nil];
[self.navigationController pushViewController:details animated:YES];

私はあなたが新鮮だと思うので、チュートリアルのリンクをチェックする必要があります

http://www.icodeblog.com/2008/08/03/iphone-programming-tutorial-transitioning-between-views/

于 2011-04-09T06:02:26.530 に答える
0

あなたのSensDetailViewClass クラスがMainWindow.xibファイルとして持っていると確信していますか?

確認してペン先名を置き換えてください`

initWithNibName:@"MainWindow"  

上記のコードで

ありがとう、

于 2011-04-09T06:07:07.120 に答える
0

1)アプリにナビゲーションコントロールがありますか*またはビューベースのアプリケーションだけですか。

これで問題がなければ、2)

// initialise the detail view controller and display it
SensDetailViewClass *details = [[SensDetailViewClass alloc] initWithNibName:@"You-Xib name for this View" bundle:nil];

// set the title of the page
[details setTitle:info.heading];

details.selectedSens = info;

[self.navigationController pushViewController:details animated:YES];
[details release];
于 2011-04-09T09:31:18.127 に答える