title: How to set a tabBarController as rootViewController
body: <p>In AppDelegate, I want to set a TabBarController as a rootViewController.</p>
  
  <p>I have tried:</p>
  
  <pre><code>UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>UITabBarController *tabBarController = [[UITabBarController alloc] init];
  self.window.rootViewController = tabBarController;
  </code></pre>
  
  <p>But It says:</p>
  
  <blockquote>
    <p>Failed to instantiate the default view controller for
    UIMainStoryboardFile 'Main' - perhaps the designated entry point is
    not set?</p>
  </blockquote>
  
  <p>My full code in AppDelegate:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
      UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
  
      UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
  
      // Movies
      MediaListViewController *moviesVC = (MediaListViewController *)[storyboard instantiateViewControllerWithIdentifier:@"MediaList"];
      moviesVC.title = @"Movies";
      moviesVC.tabBarItem.image = [[UIImage imageNamed:@"superman"] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
      UINavigationController *moviesNC = [[UINavigationController alloc] initWithRootViewController:moviesVC];
      moviesNC.navigationBar.barTintColor = [[UIColor blackColor]colorWithAlphaComponent:0.5];
      moviesNC.navigationBar.tintColor = [UIColor yellowColor];
      moviesNC.navigationBar.barStyle = UIBarStyleBlack;
  
      //DVDs
      MediaListViewController *dvdsVC = (MediaListViewController *)[storyboard instantiateViewControllerWithIdentifier:@"MediaList"];
      dvdsVC.title = @"DVDs";
      dvdsVC.tabBarItem.image = [[UIImage imageNamed:@"hulk"] imageWithRenderingMode:(UIImageRenderingModeAlwaysTemplate)];
      UINavigationController *dvdsNC = [[UINavigationController alloc] initWithRootViewController:dvdsVC];
      dvdsNC.navigationBar.barTintColor = [[UIColor blackColor]colorWithAlphaComponent:0.5];
      dvdsNC.navigationBar.tintColor = [UIColor yellowColor];
      dvdsNC.navigationBar.barStyle = UIBarStyleBlack;
  
      tabBarController.viewControllers = @[moviesNC, dvdsNC];
      tabBarController.tabBar.barTintColor = [[UIColor blackColor]colorWithAlphaComponent:0.5];
      [self.window makeKeyAndVisible];
  
      return YES;
  }
  </code></pre>