I am trying to present a NavigationController from a regular view controller. When I present the nav controller, all I see is the default navigation bar (no matter what I set it to in IB), which makes me think the navigation controller isn’t liked right in IB. This is my code to open the navigation controller:
NavigationController *navController = [[NavigationController alloc] initWithNibName:@"NavigationController" bundle:[NSBundle mainBundle]];
[self presentModalViewController:navController animated:YES];
Here is my NavigationController header:
@interface NavigationController : UINavigationController <UINavigationControllerDelegate> {
UINavigationController *navigationController;
}
@property (nonatomic,retain) IBOutlet UINavigationController *navigationController;
@end
And navigationController is synthesized in the implementation.
In IB, I have a navigation controller that is connected to navigationController and the file’s owner delegate. What am I doing wrong? Thanks
EDIT: This is what it looks like in IB:

And this is what is looks like in the simulator:

What you currently have is a subclass of a UINavigationController. That would be what you want to do if you wanted to add custom functionality to UINavigationController (like doing a different animation between views). Since it sounds like you want to make a navigation based application, you actually just want to use the plain UINavigationController class. Here is what you what you have to do to get a UINavigationController set up with the content that you want. (I am doing this in Code because I hate having to set up UINavigationController’s in IB).
In your applicationDidFinishLaunching, you want to add this bit of code.
This will create a UINavigationController and set up your table view as the content of that. When you want to do the nice animation to a new view, you do this
This will automatically do the animation to slide to the next view controller, along with making the nice back button to bring you back to your ContentViewController
EDIT: To make the navigation controller show up as a modal view controller, this is what you do. Instead of using the above code in the application delegate, you do this.
Then, when you are done with the navigation controller, and want it to go away, you do this: