[[self.parentViewController.tabBarController.tabBar.items objectAtIndex:2] title] = @"string";
The syntax here is a bit off. You probably wanted something like:
[[self.parentViewController.tabBarController.tabBar.items objectAtIndex:2].title = @"string";
However, this will not work since the title property does not exist. In fact, I see no way to change the header of the UITabBarItem after it is initialized. You will need to use the UITabBar setItems:animated: method to immediately set the entire group of elements. But it will not be fun.
I am sure this will be a violation of Apple HIG, so there is no easy way to do this using the current API. Review your design and ask yourself why you want to change the names of the tabs that will confuse your users.
Shaggy frog
source share