A way to associate a view controller with a navigation controller is to push the view controller onto the navigation stack. For instance:
UIViewController * yourViewController = [[UIViewController alloc] init]; UINavigationController * navigation = [[UINavigationController alloc] init]; [navigation pushViewController:yourViewController animated:NO]; [yourViewController release]
Finally, release the view controller at the end, as the navigation controller saves it.
source share