iPhone 101
Code Tips
Resources
Links
More
The UINavigationController is a Cocoa Touch class which manages a stack of UIView controllers (and their respective views). The nav controller is separate from the UINavigationBar (the bar that appears at the top of a view); a navigation controller may exist without a navigation bar.
Views are managed by pushing/popping them on/off the nav controller's view stack. When you push an item, the current view slides off screen to the left, and the new view slides over from the right. To push a controller:
SecondViewController *viewController = [[SecondViewController alloc] initWithNibName:@"SecondView" bundle:nil];
[[self navigationController] pushViewController:viewController animated: YES];
[viewController release];
When popping an item, the current view slides right and is deallocated:
[[self navigationController] popViewControllerAnimated:YES];
The slide-over effect only happens if the animated arguments are YES.
More Tips
• Forcing viewWillAppear/viewDidAppear to be called when using a nav controller
