title: UIToolbar in RootViewController
body: <p>I need <code>UIToolbar</code> when my application launches. It will be on every screen through out the application. So for that i have add it in <code>RootViewController</code>.</p>
  
  <pre><code>#import "AppDelegate.h"
  #import "MainViewController.h"
  
  @implementation AppDelegate
  
  @synthesize window = _window;
  @synthesize mainViewController = _mainViewController;
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
  self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];
  // Override point for customization after application launch.
  self.mainViewController = [[[MainViewController alloc]init]autorelease];
  self.window.rootViewController = self.mainViewController;
  [self.window makeKeyAndVisible];
  return YES;
  }
  </code></pre>
  
  <p>Currently i have <code>UIToolbar in MainViewController</code></p>
  
  <pre><code> // create the UIToolbar at the bottom of the MainViewController
  toolbar = [UIToolbar new];
  toolbar.barStyle = UIBarStyleBlackOpaque;
  // size up the toolbar and set its frame
  toolbar.frame = CGRectMake(0, 425, 320, 40);
  [self.view addSubview:toolbar];
  </code></pre>
  
  <p>In all my other <code>UIViewControllers</code> i m adding it like this</p>
  
  <pre><code>[self.view addSubview:toolbar]; 
  </code></pre>
  
  <p>which i don't want. I want <code>UIToolbar</code> to show automatically in all my other <code>UIViewControllers</code> after attaching it to <code>rootviewcontroller</code>. so that when i flip <code>UIViewController</code> to change to another <code>UIViewController</code>. Only <code>UIViewController</code> should flip not <code>UIToolbar</code>.Right now <code>UIToolbar</code> is also flipping with <code>UIViewController</code>. So that is the reason i want to attach it to the <code>rootviewcontroller</code>. </p>
  
  <p>So how can i add <code>UIToolbar in APPDelegate</code> file and attach it to <code>rootviewcontroller</code>.</p>
  
  <p>Thanks for help.</p>