• Welcome to the new Mac-Forums. See News and Community Announcements for more details.

How to from viewController to NavigationController?

Jul 13, 2013
Reaction score
Hi everyone. I'm new to objective c but I think I know what I'm doing wrong, I just does not know how to fix it.

I'm using xcode 4.6.3, using storyboards

The problem:

I have an initial viewController. In this view controller I have a picker View and a button.

Based on what the user chooses I want that he goes to ViewController A or ViewController B.

Until here, everything is fine, I know how to do this. The problem is I want that the View Controller B be managed by an Navigation Controller. So instead instanciate the ViewController B, I should instanciate the navigation Controller.

To call the ViewController B I'm using:


AgeViewController *ageViewController = [self.storyboard instantiateViewControllerWithIdentifier:mad:"AgeViewController"];

[self presentViewController:ageViewController animated:YES completion:nil];


Could someone help me?

Thanks in advance!