In XCode 4.2 when I select “new project” and also select “single view application” but now I want to add a navigation controller. What can I do in Xcode 4.2 to do it? (without storyboard)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unless you are adding the UINavigationController to another UIViewController that is utilized for a different method of navigation, i.e. UISplitViewController or UITabBarController, I would recommend adding the UINavigationController to your application window in the AppDelegate then add the UIViewController that has your view in it.
If you are adding the UINavigationController as your main UIViewController, you can easily do this programmatically in the following method in the AppDelegate:
The code I would add is:
Now, in your AppDelegate.m it should look like this:
You can further learn how to utilize the UINavigationController by checking out the UINavigationController Apple Documentation and their example projects, which you can download from the same documentation page. The example projects will help you grasp the various ways you can utilize the UINavigationController.