I upgraded to XCode 4.2. When my app is run in the iOS 4.0 simulator, the navigation bar is displayed on multiple views that are pushed into. When the app is run in the iOS 5.0 simulator and on a device with iOS 5.0, the navigation bar is gone in all the views, and the table views are pushed up to fill that space. The navigation controller is created using the following code:
navigationController = [[UINavigationController alloc] initWithRootViewController:swViewController];
and the views are pushed onto the navigationController like so:
UIBarButtonItem *backButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"NextLevel" style:UIBarButtonItemStylePlain target:nil action:nil] autorelease] ;
self.navigationItem.backBarButtonItem = backButtonItem;
[self.navigationController pushViewController:self.listController animated:YES];
The navigationController is added to the window via:
[window addSubview:self.navigationController.view];
Update 1 - It looks like the navigation bar's default in iOS 5 is hidden, so I added
[[self navigationController] setNavigationBarHidden:NO animated:YES];
and I now see the navigation bar, but no back button as specified in backButtonItem.
Update 2 - I also set the navigationController title, but that doesn't show up either.
self.navigationController.title = @"Title";
Is there something that is missing or is needed for the navigation bar to be visible at the top in iOS 5.0?