0

I'm trying to update the tabBarItem more than once, but I can't get it to work.

I've used theese methods:

self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"New title" image:image tag:0] autorelease];

and:

self.tabBarItem.title = @"New title";
self.tabBarItem.image = image;

And they work, but only once. So now I'm stuck.

Any help is appreciated.

Thanks

Stefan Edberg
  • 231
  • 2
  • 4
  • 15

1 Answers1

0

The documentation for both the title and image properties notes:

You should set this property before adding the item to a bar.

It is probably wise to heed this advice. If you want to change the properties, just create a new tab bar item with the new settings and assign it to self.tabBarItem.

Ole Begemann
  • 135,006
  • 31
  • 278
  • 256
  • Yes, that was my first guess, but it still doesn't update more than once. This is the code that i use: self.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"New title" image:image tag:0] autorelease]; – Stefan Edberg Apr 10 '11 at 10:21