title: Attempt to present <ViewController:> on <UITabBarController > whose view is not in the window hierarchy
body: <p>I want a particular tab to be opened at launch time in a tab bar application.I get the warning<code>Warning: Attempt to present &lt;settingsViewController: 0x16e49870&gt; on &lt;UITabBarController: 0x16d25440&gt; whose view is not in the window hierarchy!</code>.</p>
  
  <pre><code>self.tabBarController.selectedIndex = 1;
  </code></pre>
  
  <p>I tried in DidFinishLaunching</p>
  
  <pre><code> UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
  
  
  numpadviewcontroller = [[tabBarController viewControllers] objectAtIndex:0];
  settingsviewcontroller = [[tabBarController viewControllers] objectAtIndex:1];
  [tabBarController setSelectedIndex:1];
  </code></pre>
  
  <p>But getting the same warning.I am using storyboards</p>
  
  <p>I tried the code in viewWillAppear,ViewDidLoad also of the first controller of tab bar but i get the same error.</p>