Reputation: 523
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] delegate];
[delegate.navigationController pushViewController:newView animation:YES];
or should I use another way?
Upvotes: 1
Views: 3028
Reputation: 29892
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];
Upvotes: 1