title: DismissViewControllerAnimated is not working
body: <p>Working with local push notifications if the notification receives its move to <code>NotificationViewcontroller</code> there is no notification it moves the <code>main view controller</code> .
  Here I'm using code:</p>
  
  <pre><code>- (void)applicationWillEnterForeground:(UIApplication *)application
   {
  
      if ([status isEqualToString:@"YES"])
      {
          NotificationViewcontroller *notify_view =[[NotificationViewcontroller alloc]init];
          [self.window.rootViewController presentViewController:notify_view animated:YES completion:nil];
  </code></pre>
  
  <p>when i use this code means it should not move to <code>NotificationViewcontroller</code> i got this <code>errorr:
  </code> whose view is not in the window hierarchy!`</p>
  
  <pre><code>   // self.window.rootViewController=notify_view;
  </code></pre>
  
  <p>i use this code it move to <code>NotificationViewcontroller</code>. after seeing the notification put one back button to go view controller</p>
  
  <pre><code>    NSLog(@"Go to some other view");
  
  
  }
  else
  {
      [self.window.rootViewController dismissViewControllerAnimated:YES  completion:nil];
  }
  </code></pre>
  
  <p>After see the notification put one back button to go <code>view controller</code> that back button is not working.</p>
  
  <pre><code>-(IBAction)back_btn:(id)sender
  {
  [self.window.rootViewController dismissViewControllerAnimated:YES  completion:nil];
  
  }
  </code></pre>