Reputation: 2543
My app setup is the following
With this setup, when I press the button in table 2 it pushes the view (table3) in the "nav 2" hierarchy.
What I need to do is to press the button on table 2 and push the view (table3) but in the hierarchy of the "nav 1". And if I press the "back" button in table 3, I want to go to the "Table 1", and NOT being able to return to the table2 view.
I need to do this programmatically. Im a beginner in iOS development, and I know I should modify use the method:
[self.navigationController pushViewController:..........];
But the problem is that in this way I am pushing it to the navigation controller of "self" meaning nav2. How do I push it to nav1?
NOTE: The layout I need is similar to the one found in "Messages" app when adding a new message thread.
Thank you!
Upvotes: 0
Views: 248
Reputation: 2261
In the message app, it looks like they are presented in a modal view. Then if you press the + button to get to the contacts it brings up another modal view wrapped in a NavigationController. If your using X-ode 4.2 and create a new ViewController in the storyboard there an option in the editor menu to embed that view in a NavigationController. then just present that view modally.
Upvotes: 0
Reputation: 14154
If you are trying to model the Messages app of navigation, you need to present a modal view controller with a navigation controller.
NewViewController *newVC = [[NewViewController alloc] initWithNibName:@"NewViewController" bundle:nil];
UINavigationController *newNav = [[UINavigationController alloc] initWithRootViewController:newVC];
[newVC release];
[self.navigationController presentModalViewController:newNav animated:YES];
Upvotes: 2