I want to set title to tab item programatically, but it not works. My code is below:
- (IBAction)tab1Click:(id)sender {
myTabBarController = [[UITabBarContro
[view2Controller setTitle:@"ImATitle"];
might be what your after
edit: ok i just tested this and it def works for me so give it a go
UINavigationController *nav1 = [[UINavigationController alloc] init];
myViewController *myView = [[myViewController alloc] init];
//myView.title = @"Title"; //prob not needed
[nav1 pushViewController: myView animated:NO];
UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"Title" image:[UIImage imageNamed:@"title.png"] tag:0];
nav1.tabBarItem = item;
UITabBarController *tbc = [[UITabBarController alloc] init];
tbc.viewControllers = [NSArray arrayWithObjects:nav1, nil];