Tab Bar Item title before appear Storyboard
iphone, storyboard, uitabbarcontroller
Solution
I had the same problem today. I'm using storyboard too. In my case i used the following way.
- I've created a new "Objective-C class" with the name "MainTabBarViewController" as a subclass of "UITabBarController".
In my storyboard in "identity inspector" i changed "Custom class" to "MainTabBarViewController".
In the method "viewDidLoad" in "MainTabBarViewController" i added:
[[self.viewControllers objectAtIndex:0] setTitle:NSLocalizedString(@"home", nil)];
[[self.viewControllers objectAtIndex:1] setTitle:NSLocalizedString(@"statistics", nil)];
[[self.viewControllers objectAtIndex:2] setTitle:NSLocalizedString(@"settings", nil)];
[[self.viewControllers objectAtIndex:3] setTitle:NSLocalizedString(@"info", nil)];
I guess it is not the perferct way, but for me it works perfect.
Problem
my app starts with a tab bar controller which have 5 tabs. At start the first one in presented with its name but the other four don't have a name until I click on them. Then the name appears depending which language the user has. How can I set the name of the tabs before the tab bar appears? I am using storyboard. Is there a way to set title at the tab bar programmatically when all the rest is done with storyboard? I tried in the AppDelegate something like `[FirstViewController setTitle:NSLocalizedString(@"Titel1", nil)];` But I got an error that there is no class method for selector setTitle. Thanks.