title: Whose view is not in window hierarchy issue
body: <p>I've set up a navController, which appears after tapping a button. However, if I tap the button I get the error of: "<code>Warning: Attempt to present &lt;UINavigationController&gt;: 0xab5d9d0 on &lt;MyApp: 0xadaa320&gt; whose view is not in the window hierarchy!</code>" </p>
  
  <p>Does anyone know how to solve this? I also tried something on Stackoverflow but it wasn't my solution. </p>
  
  <p>Here my code for opening the navigationcontroller:</p>
  
  <p>I dont know if somebody know this photogallery but if you don't, <a href="https://github.com/mwaterfall/MWPhotoBrowser" rel="noreferrer">here</a> is the project.</p>
  
  <p><strong>My code (MyApp.m):</strong></p>
  
  <pre><code>#import MyApp.h
  ...
  //some stuff
  - (void)launchGalleryView
  {
  
  
  
      MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:self];
  
      // Set browser options.
      browser.wantsFullScreenLayout = YES;
      browser.displayActionButton = NO;
  
  
      UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:browser];
  
      NSMutableArray *photos = [[NSMutableArray alloc] init];
      MWPhoto *photo;
      photo = [MWPhoto photoWithFilePath:[[NSBundle mainBundle] pathForResource:@"callculator" ofType:@"jpg"]];
      photo.caption = @"The calculator is soo beateful...";
      [photos addObject:photo];
  
      self.photos = photos;
  
      [self presentModalViewController:navController animated:NO];
  }
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>it is in the recources and in the compile sources but in the resources you can see that it is red (the storyboard). Maybe it's caused by  this?</p>
  
  <p><strong>The Second controller .h:</strong> </p>
  
  <pre><code>@class MyApp;
  
  @interface Second : UIViewController &lt;MWPhotoBrowserDelegate&gt; {
  
  }
  
  
  
  @property (nonatomic, retain) MyApp* vC;
  
  @end
  </code></pre>
  
  <p><strong>The Secnond controller .m:</strong></p>
  
  <pre><code>#import "Second.h"
  #import "MyApp.h"
  
  
  @interface Second ()
  
  @end
  
  @implementation Second
  
  @synthesize vC;
      //some stuff in here
  
  
  //the action 
      - (IBAction)dothis:(id)sender {
  
          NSLog(@"launch the navcontroller");
  
  
          [self.vC launchGalleryView];
  
      }
  </code></pre>
  
  <p><strong>MyApp.h:</strong></p>
  
  <pre><code>#import "Second.h"
  
  
  @interface myApp : UIViewController  &lt;MWPhotoBrowserDelegate&gt; {
      }
  
  -(void)launchGalleryView;
  
  NSArray *_photos;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/FLHd0.png" alt="enter image description here"></p>
  
  <p><strong>NEW EDIT:</strong></p>
  
  <p>I found that I have to call the method "launchGalleryView" in the viewDidAppear but how can I do this without calling the navcontroller everytime the view loads? Does anyone know how to do this?</p>