Introduce Navigation controller is implemented as class UINavigationController. It is used to build hierarchical applications, it manages a group of view controllers as a stack. UINavigationController contains 3 parts, UINavigationBar, UIViewController, and UIToolBar. Navigation controller usually is used with UITableView.
View Controllers in Navigation Controllers
Root View Controller It is the first view controller the navigation controller pushes onto its stack, so it is the bottommost view controller in the view hierarchy.
Sub View Controllers To drill down into a sub view from root view, jsut create a new sub view controller and push it onto the navigation controller.
How to Create Navigation Controller
Define Root View Controller Define a class inherits from UIViewController or UITableViewController
Define Sub View Controllers Define classes inherit from UIViewController or UITableViewController
Create Navigation Controller
Where To Create Navigation Controller A -> B -> C/D/E/F, if B is root view controller, and C,D,E,F are sub view controllers, you must define a field of type (UINavigationController *) in class A, and create its intance in A; a -> b/c/d/e/f, if a is root view controller, and b,c,d,e,f are sub view controllers, you must define a field of type (UINavigationController *) in subclass of UIApplicationDalegate
How to Create Root View Controller You can create Navigation Controller in code, and you can also create it in Nib. If you create navigation controller in Nib file, just expand navigation controller icon, and single click View Controller icon under navigation controller, then press Command-4 to bring up identity inspector, change the underlying class to the class name of root view controller.
...
Show Root View If you create Navigation Controller in code, when you display root
view, you must create an instance of root view controller, then call
UINavigationController:pushViewController:animated: to push it onto
navigation controller, finally, call [window addSubview:
navController.view] (Here, window is instance of UIWindow, and
navController is instance of UINavigationController) to show root view. If you create navigation controller in Nib, and have set underlying class of navigation controller to root view controller, here just call [window addSubview:
navController.view] to show root view.
Show Sub View Call UINavigationController:pushViewController:animated: to add sub view on root view or other sub view.
Popup View If Back button on navigation controller is press, the sub view controller is poped, and previous view is show, ou can manual to pop current sub view by calling UINavigationController:popViewControllerAnimated:.
...
Advanced More details about navigation controller, please refer to http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UINavigationController_Class/Reference/Reference.html
...
Reference
Beginning iPhone Development: Exploring the iPhone SDK Chapter: Application Settings and User Defaults Page: P231~301