私は複数のビューを持つアプリケーションを持っています。別のボタンをクリックして別のビューを選択することができます。その中の1つはテーブルを表示します。その行のセルを選択すると、新しいビューが表示されます。ビューがロードされたことを示すログ行が表示されますが、画面は変更されません。 ItemDetailsViewControllerでUITableViewで行を選択するときに新しいビューを表示
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *targetCustomCell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSLog(@"in didSelectRowAtIndexPath");
ItemDetailsViewController *detailsController = [[ItemDetailsViewController alloc] initWithNibName:@"ItemDetailsView" bundle:nil];
[self.navigationController pushViewController:detailsController animated:YES];
[self.window addSubview:[detailsController view]];
[detailsController release];
detailsController = nil;
}
、私は
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"in ItemDetailsViewController.viewDidLoad ");
}
は、私は両方のログ行が表示されているが、画面は変化しません。ビューが変わっていないのはなぜですか?ビューを変更する他の方法がありますか?
前の質問(http://stackoverflow.com/questions/948874/)に基づいて働いているpresentModalViewControllerを使用して、私はUINavigationControllerではなくUIViewControllerを拡張するコントローラを1つ持っていました。別のコントローラを作成する必要がありますか、またはUINavigationControllerをアプリケーションデリゲートに追加してそこからアクセスする必要がありますか? –