1

I want to be able to change the page's title without affecting the tab bar's title. My current implementation is as follows:

//Setting page and UITabbar title in app delegate
ForYouViewController *fuvc = [[ForYouViewController alloc]init];
fuvc.title = @"Questions";
UITabBarItem *tempTabBarItem1 = [[UITabBarItem alloc]initWithTitle:@"Questions" image:nil tag:QUESTIONTAB_INDEX];

Before clicking on questions tab

enter image description here

//After changing the title's page in view did load of "ForYouViewController"
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"Latest";
}

After clicking on questions tab (tab bar title changed)

enter image description here

How can I set the the page title such that it does not alter the tab bar's description?

Zhen
  • 12,361
  • 38
  • 122
  • 199

1 Answers1

0

You can try this

YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];

[appDelegate tempTabBarItem1] setTitle:@"Questions"];
sicKo
  • 1,241
  • 1
  • 12
  • 35
  • Potential issue if this is called before the `title` is set on the view controller, the title for the bar item will be replaced by going through the setter for `title`. It may be a good idea to supply the title by overriding `-title`. – Mark Adams Oct 07 '11 at 07:31