Changing the name of UITabBarItem dynamically

I have 9 tabs in my tab ... And I want to change the name of all of them from some kind of controller. and I did it as follows:

for (int i=0; i(less than)[appDelegate.tabBarController.viewControllers count]; i++) {
  UIViewController *uv=[appDelegate.tabBarController.viewControllers objectAtIndex:i];
  uv.tabBarItem.title=@"test";
}

It changes the name for all visible tabs instantly, but doesn’t work for tabs anymore ...

However, if I click the "Edit" button in the more navigational cntrl, the changed name will be displayed. Also ... very strange ... If I select any tab more, all the tabs will display a new name
why is this ???

+5
source share
1 answer

UIBarItem ( UITabBarItem) , Apple. , iOS , , .

UIBarItem:


, .

@property (, ) NSString * title


, . nil.

+1

All Articles