tags:

views:

64

answers:

1

HI, i have added the following in Appdelegate.m file to hide particular tab bar item("Hai") in tab bar controller(created by IB).but it did not work

 - (void)tabBarController:(UITabBarController *)tabBarController    didSelectViewController:(UIViewController *)viewController 
   {
  if ([viewController.tabBarItem.title isEqualToString:@"Hai"])
      {
      self.tabBarController.tabBar.hidden = YES;
  }

    }
+2  A: 

There is no way to hide a tab bar item, but you could create an array of view controllers and exclude this particular one from that array. Later when the tab should be visible, set the view controllers for the tab bar controller again and include that view controller this time.

- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated
Anurag