Julian Julian - 2 months ago 30
iOS Question

How can I localize my UITabBarItems?

I'm beginning to learn how to localize iOS applications and hit a wall while trying to localize my UITabBarItems.

Note that these were created in interface builder (using XCode 4).

Is there a way to do this or would I need to create the UITabBarController using just code and manually inserting a localized string for each UITabBarItem?



I do know that I can set the tile of a UITabBarItem by setting the view controller's title like so:

- (void)viewDidLoad
[super viewDidLoad];
self.title = NSLocalizedString(@"Test", @"");

... but this only woks once you hit the tab bar item. Before that it just shows what you put in interface builder...


It seems to work if you set title in awakeFromNib instead:

- (void)awakeFromNib
    self.title = NSLocalizedString(@"Test", @"");