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];
精彩评论