title: Adding UIButton to UITabBar
body: <p>I'm trying to add a UIButton to UITabBar in my iPad application with following code:</p>
  
  <pre><code>TabBarAppDelegate *delegate = (TabBarAppDelegate *)[[UIApplication sharedApplication] delegate];
  UITabBarController *tabbar = (UITabBarController *)delegate.window.rootViewController;
  
  UIButton *b = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
  [tabbar.view addSubview:b];
  </code></pre>
  
  <p><code>tabbar</code> is OK and referencing to a correct tabbar item (say, I can switch active tab with following code: <code>[tabbar setSelectedIndex:1];</code>).</p>
  
  <p>This code is called by some other custom button. Though there are no errors in the log, the button doesn't show on the tabbar :(</p>
  
  <p>What am I doing wrong and what is a right way to add UIButton to UITabBar? :) Here is an example:</p>
  
  <p><a href="http://gyazo.com/99fc0df0ed47dd6be91b558161cab4f9.png" rel="nofollow">http://gyazo.com/99fc0df0ed47dd6be91b558161cab4f9.png</a></p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Edit:</strong> OK, if I'll stick to UIToolbar option, then what is a right way to switch between views? Create an NSArray of ViewContollers and load corresponding ViewController's view to an active View?</p>