self.tabBarItem.title not working?

Isaac Waller picture Isaac Waller · Apr 4, 2009 · Viewed 9.5k times · Source

In my iPhone application, I have a tab bar. This tab bar holds a UINavigationController. I have:

  • In Interface Builder set the tab item title to 'Create New'
  • In the UINavigation controller I have self.tabBarItem.title = 'Create New'; and self.title = 'Create New';
  • In the UIViewController pushed onto the controller: self.tabBarItem.title = 'Create New'; but self.title = 'Blah';.

But, always, the self.title of the first view controller pushed onto the navigation controller is shown (Blah). How would you set the title of the tab bar item? Thanks, Isaac Waller

Answer

Isaac Waller picture Isaac Waller · Apr 6, 2009

I found if I used self.navigationItem.title = 'Blah'; instead of self.title, it would work.