title: How to control view controllers in appdelegate?
body: <p>I really struct for the simple problem.</p>
  
  <p>I am simply moving from one view controller to another view controller using the following code.</p>
  
  <pre><code>homescreen *home;
  home=[self.storyboard instantiateViewControllerWithIdentifier:@"home"];
  [self presentViewController:home animated:YES completion:nil];
  </code></pre>
  
  <p>Same code tried using in <code>AppDelegate</code> method.</p>
  
  <pre><code>UIStoryboard *storyboard;
  sur= [storyboard instantiateViewControllerWithIdentifier:@"survey"];
  [self.window.rootViewController presentViewController:sur animated:YES completion:nil];
  </code></pre>
  
  <p>When I am using this code I get this crash:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target</p>
  </blockquote>
  
  <p>i don't want to make it as root view controller ,simply i need to move it.</p>