开发者

Present a modal UINavigationController

in my app delegate I do this:

navigationController = [[[UINavigationController alloc] initWithRootViewController:homePageController] autorelease];
[tabBarController presentModalViewController:navigationController animated:YES];

for present a modal UINavigationController. But in the homePageController how can I push other views in that navigation controller?

Should I call in the homePageController's methods this?

MyDelegate *delegate = (MyDelegate *) [[UIApplication sharedApplication] 开发者_StackOverflowdelegate];
[delegate.navigationController pushViewController:newView animation:YES];

or should I use another way?


You can access the parent navigation controller of any UIViewController through the navigationController property. So, in your HomePageController methods:

[self.navigationController pushViewController:someViewController animated:YES];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜