Set different UINavigationController titles for embedded UITabBar subviews?

ios, objective-c, uinavigationcontroller, uitabbarcontroller

Solution

Looks quite straight forward.

Set a UITabBarDelegate as your UITabBarController subclass and implement the delegate method -

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item

Inside this method set the respective title based on the tab selected. It should work!

Problem

In my app I have embedded a UITabBarController inside of my UINavigationController. The problem is that the UINavigationController treats that tab bar as a single view controller even though there are 4 tabs in it. I am needing to have a different header title for each of those 4 tabs that displays in the navigation bar header. Using self.title on a subclass for those 4 views does nothing. It just displays the same title in the navigation bar constantly because like I said, the UINavigationController treats that entire tab bar controller as a single view. How can I have separate titles for each of my views that are tabs inside the tab bar controller?

Original source