title: Checking when a TabBar item is clicked - Objective C
body: <p>I have a <code>ViewController</code> with 2 <code>sub containers</code>.  The first <code>sub container</code> points to a <code>ViewController</code> with a <code>TabBar</code> inside it.  The second <code>sub container</code> is a <code>ViewController</code> that contains a <code>collection view</code>.  Now my issue is trying to access the first <code>sub containers</code> <code>TabBar</code> so that when an Item is clicked, I can know which item is clicked and process my data.  </p>
  
  <p>The main <code>ViewController</code> has a class.  All the other <code>sub containers</code> for that <code>ViewController</code> also have a class.  Here is the <code>.h</code> for my <code>sub container</code> with the <code>Tab Bar</code>:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  
  @interface home_tab : UIViewController &lt;UITabBarControllerDelegate&gt;{
  
  }
  @end
  </code></pre>
  
  <p><code>.m</code>:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  }
  -(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
  {
      NSLog(@"working");
  
  }
  </code></pre>
  
  <p>Now when clicking on the <code>Tab Bar</code> that is populated, <code>didSelectViewController</code> is never called.  </p>
  
  <p>I am using storyboard.</p>
  
  <p>Suggestions and thoughts?</p>