実際、問題は質問のタイトルにあります。問題は、アプリケーションで UITabBarController のアクティブなタブを変更する必要があることです。私は次のようにしてそれを行います:
[self.tabBarController setSelectedIndex:2]; //2 is just for instance
奇妙なことに、選択したタブが実際に変更されますが、このタブのタイトルの色は同じまま (灰色) のままで、タブをタップしたかのように白くしたいのです。何か提案はありますか?
編集:
タブバーの初期状態を設定するコードは次のとおりです。
UITabBarController *mvc = [[UITabBarController alloc]init];
AccountManagmentViewController *accountvc = [[AccountManagmentViewController alloc]init];
ListTableViewController *ltvc = [[ListTableViewController alloc]init];
UINavigationController *listNavcon = [[UINavigationController alloc]initWithRootViewController:ltvc];
CalendarViewController *calendarvc = [[CalendarViewController alloc]init];
UINavigationController *calendarNavcon = [[UINavigationController alloc]initWithRootViewController:calendarvc];
ListsManagerViewController *listsManager = [[ListsManagerViewController alloc]init];
UINavigationController *listsNavcon = [[UINavigationController alloc]initWithRootViewController:listsManager];
SettingsViewController *settings = [[SettingsViewController alloc]init];
UINavigationController *settingsNav = [[UINavigationController alloc]initWithRootViewController:settings];
[accountvc.tabBarItem setFinishedSelectedImage:[[EasyUITheme currentTheme]tabBarUserIconImageActive:YES] withFinishedUnselectedImage:[[EasyUITheme currentTheme]tabBarUserIconImageActive:NO]];
[listsNavcon.tabBarItem setFinishedSelectedImage:[[EasyUITheme currentTheme]tabBarListsIconImageActive:YES] withFinishedUnselectedImage:[[EasyUITheme currentTheme]tabBarListsIconImageActive:NO]];
[calendarNavcon.tabBarItem setFinishedSelectedImage:[[EasyUITheme currentTheme]tabBarCalendarIconImageActive:YES] withFinishedUnselectedImage:[[EasyUITheme currentTheme]tabBarCalendarIconImageActive:NO]];
[listNavcon.tabBarItem setFinishedSelectedImage:[[EasyUITheme currentTheme]tabBarMain10IconImageActive:YES] withFinishedUnselectedImage:[[EasyUITheme currentTheme]tabBarMain10IconImageActive:NO]];
[settings.tabBarItem setFinishedSelectedImage:[[EasyUITheme currentTheme]tabBarSettingsIconImageActive:YES] withFinishedUnselectedImage:[[EasyUITheme currentTheme]tabBarSettingsIconImageActive:NO]];
[accountvc.tabBarItem setTitle:NSLocalizedString(@"Account", nil)];
[listsNavcon.tabBarItem setTitle:NSLocalizedString(@"Lists", nil)];
[calendarNavcon.tabBarItem setTitle:NSLocalizedString(@"Calendar", nil)];
[listNavcon.tabBarItem setTitle:NSLocalizedString(@"Words", nil)];
[settings.tabBarItem setTitle:NSLocalizedString(@"Settings", nil)];