I’m having trouble figuring out how to add a navigationcontroller to my iOS app. I need all of the views except the “home” screen to have a back button but I’m not sure how to add it.
Here is a link to my project:
https://www.dropbox.com/s/sv0y3oh1aftxl95/KFBNewsroom%204.zip
Remove the navigation bars from all of your NIBs and use a navigation controller (such as in the app delegate like NeverBe outlined), and then transition to the child controllers via a
pushViewControllerrather thanpresentViewControlleras you’re currently doing, and you should get your “back” button automatically. You’ll also want to remove any references todismissViewControllerAnimated, if you have any, as your back button will now dopopViewControllerAnimatedfor you. If you need to programmatically pop anywhere, though, you can just usedpopViewControllerAnimated.In your NIBs, you might also want to tweak the simulated metrics so you can design your NIBs with the navigation bar graphically represented, e.g.:
See the navigation controller section of the View Controller Catalog and refer to the
UINavigationControllerClass Reference.