views:

243

answers:

1

I am pushing 2 view controllers in to navigation stack in ApplicationDidFinishLaunching.

[navigationController pushViewController:favorites animated:NO];
[navigationController pushViewController:root animated:NO];

The app loads fine, but on the start screen, the back button title is simply "Back". I do have a title for the FavoritesViewController, and a navigationItem title setup to Favorites.

Am I missing something?

Appreciate your help.

A: 

I found a solution to this problem.

The problem was that when the first page was being displayed, the Favorites page is not being initated, and so its title value not displayed. The following code, adds the title value to view controller!

NSArray *viewControllerArray = [self.navigationController viewControllers]; int parentViewControllerIndex = [viewControllerArray count] - 2; [[viewControllerArray objectAtIndex:parentViewControllerIndex] setTitle:@"Favorites"];

Prasanna