title: How to access Tab View Controller from another View Controller
body: <p><img src="https://i.stack.imgur.com/9X8XN.jpg" alt="my storyboard">I'm having trouble accessing my view controllers under the tab bar controller. Here is what my storyboard looks like:</p>
  
  <ol>
  <li>View Controller A (-> Page View Controller -> View Controller C</li>
  <li>View Controller A -> Tab Bar Controller  (MyTabBarController.h/.m) -> Navigation Controller (MyNavigationController.h/.m)-> View Controller B (TabViewController.h/.m)</li>
  <li>Tab Bar Controller  (MyTabBarController.h/.m) -> View Controller D</li>
  <li>Tab Bar Controller  (MyTabBarController.h/.m) -> View Controller E</li>
  </ol>
  
  <p>From View Controller A I have an IBAction called loginButton that is connected to the Tab Bar Controller, and currently it looks like this:</p>
  
  <pre><code>- (IBAction)loginButton:(id)sender {
  
      MyNavigationController *localNavigationController;
  
      UIStoryboard * storyboard = self.storyboard;
  
      MyTabBarController *tbc = [[MyTabBarController alloc] init];
  
      NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:1];
  
      TabViewController *login = [storyboard instantiateViewControllerWithIdentifier: @ "TabViewController"];
  
      localNavigationController = [[UINavigationController alloc] initWithRootViewController:login];
  
      localNavigationController.delegate = self;
  
      [localControllersArray addObject:localNavigationController];
  
  
      tbc.viewControllers = localControllersArray;
  
  
      tbc.delegate = self;
      tbc.moreNavigationController.delegate = self;
  
  
      tbc.selectedIndex = 0;
  
      [self presentViewController:tbc animated:YES completion:^{
  
      }];
  
  }
  </code></pre>
  
  <p>I'm not able to get this displayed correctly. I am getting a bunch of warnings in this piece of code. and it is also not showing the different tab items in the bottom of the Tab Bar, even though I have put images/text on each tab.</p>
  
  <p>So how do I display/access the view controllers inside the Tab Bar Controller correctly? (ie View Controllers C/D/E)?</p>