1

I wish to have it so the view controller's title is different to the tab bar item's title.

I have tried the following, inside viewDidLoad

[self setTitle:@"My title"];
[[self tabBarItem] setTitle:@"Search"];

But the call to the second function doesn't seem to work

Chris James
  • 11,571
  • 11
  • 61
  • 89

1 Answers1

5

I use this to set my title and make it different from my tabBarItem:

self.navigationController.navigationBar.topItem.title = @"My Title";
Brad
  • 705
  • 7
  • 21
  • This is also the preferred way to set or change the title of your view controller after it has been pushed, i.e. if the title contents will only be available after loading more data. – DrMickeyLauer Feb 07 '12 at 13:23