views:

1253

answers:

1

Hello,
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

+2  A: 

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

Isaac Waller
Yes. Both the TabBarItem and the NavigationBar inherites self.title. However, for some reason, the title cannot be changed for the TabBarItem, only the NavigationItem. It's weird. Also, self.title should be set before the navigationItem.title. Just FYI :)
Canada Dev