title: how to run code in tabbarcontroller
body: <p>Im trying to change the icon tint of my unselected tab bar icon images.  I have used the patch code below, however, the post that i found this patch code in says to run this in the tab bar controller but i did not know how to do that so i ran it in the -(void)viewDidLoad method in the viewcontroller .m file. It came up with an error saying "Property 'tabBar' not found on object of type 'ViewController *'"  How do i fix this? </p>
  
  <pre><code>// set color of selected icons and text to red
  self.tabBar.tintColor = [UIColor redColor];
  [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor redColor], NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
  
  
  // set color of unselected text to green
  [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor greenColor], NSForegroundColorAttributeName, nil]
                                           forState:UIControlStateNormal];
  
  // set selected and unselected icons
  UITabBarItem *item0 = [self.tabBar.items objectAtIndex:0];
  
  // this way, the icon gets rendered as it is (thus, it needs to be green in this example)
  item0.image = [[UIImage imageNamed:@"unselected-icon.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  
  // this icon is used for selected tab and it will get tinted as defined in self.tabBar.tintColor
  item0.selectedImage = [UIImage imageNamed:@"selected-icon.png"];
  </code></pre>