Chris James
Chris James

Reputation: 11701

Changing the title of a UITabBarItem without changing the view controller's title

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

Upvotes: 1

Views: 698

Answers (1)

Brad
Brad

Reputation: 705

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

self.navigationController.navigationBar.topItem.title = @"My Title";

Upvotes: 5

Related Questions