title: Enable and disable the tab bar item by a button click in xcode?
body: <p>I have 5 tab bar items. The first one will be the login page. When the user haven't logged on other tab bat items will be disabled, but when the user logged by clicking the navigationItem button all the other 4 tab bat items will be enabled.</p>
  
  <p>I have made searched and found nothing... :(</p>
  
  <p>Here's my code:</p>
  
  <pre><code>MainTabViewController.h
  #import &lt;UIKit/UIKit.h&gt;
  
  @interface MainTabViewController : UITabBarController
  @property (retain, nonatomic) IBOutlet UITabBar *MainTabBar;
  
  @end
  
  
  MainTabViewController.m
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
  
  
      UITabBarItem *tabBarItem = [[MainTabBar items] objectAtIndex:1];
      [tabBarItem setEnabled:FALSE];
  
  
  }
  
  LoginViewController.h
  
  
  
  #import &lt;UIKit/UIKit.h&gt;
  
  @interface LoginViewController : UIViewController
  @property (retain, nonatomic) IBOutlet UITextField *CustomerUsername;
  @property (retain, nonatomic) IBOutlet UITextField *CustomerPassword;
  - (IBAction)ResignKeyboardClicked:(id)sender;
  
  @end
  
  LoginViewController.m
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
  
      UIBarButtonItem *btnGo = [[UIBarButtonItem alloc] initWithTitle:@"Login"     style:UIBarButtonItemStyleBordered target:self action:@selector(loginAction)];
      self.navigationItem.rightBarButtonItem = btnGo;
  
  }
  
  - (void) LoginAction {
       AppDelegate *passData = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  
          if ([CustomerUsername.text isEqualToString:@""] || [CustomerPassword.text     isEqualToString:@""]) {
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:@"Please Fill     all the field" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
          [alert show];
  
          return;
      }
      // i will use a code from connect to DB tutorial
      NSString *strURL = [NSString stringWithFormat:@"http://localhost:8888/Staff.php?userName=%@&amp;password=%@",CustomerUsername.text, CustomerPassword.text];
  
      // to execute php code
      NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
  
      // to receive the returend value
      NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
  
  
      if ([strResult isEqualToString:@"1"])
      {
          //MainTabViewController *main = [[MainTabViewController alloc] initWithNibName:nil bundle:nil];
          //UITabBarItem *tabBarItem = [[main.MainTabBar items] objectAtIndex:1];
          //[tabBarItem setEnabled:TRUE];
  
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success" message:@"You are now Logged In" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
          [alert show];
  
      return;
      }
      else
      {
          // invalid information
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:@"Invalide Information" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
          [alert show];
  
          return;
  
      }
  }
  </code></pre>
  
  <p>For now my code only disable the other 4 tab bar items but I do not know the way to enable all the tab bat items when the user is logged in.</p>
  
  <p>Please help?</p>
  
  <p>Thanks! :D</p>