5

を使用してビューを表示しpresentModalViewControllerます。これから、 usingUIViewをプッシュしたいと思います。私はこれのために以下のコードを試しましたUIViewUINavigationController

[self.parentViewController.navigationController 
                pushViewController:objViewFullScreen 
                          animated:YES];

しかし、それは私にはうまくいきませんでした。からビューをプッシュする方法を誰か提案してくださいModelViewController

ありがとう

4

2 に答える 2

8

最初に、モーダル ビュー コントローラーをナビゲーション コントローラー内に提示する必要があります。

MyViewController *vc = [[MyViewController alloc] initWithNibName:@"MyNib" bundle:nil];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:vc];

[self presentModalViewController:nc animated:YES];

[vc release];
[nc release];

次に、内部で次のMyViewControllerことができます。

OtherViewController *vc = [[OtherViewController alloc] initWithNibName:@"MyOtherNib" bundle:nil];
[self.navigationController pushViewController:vc animated:YES];
[vc release];
于 2011-07-21T08:20:51.670 に答える