title: Got to another view controller before the current view controller appears
body: <p>I am trying to to go to a new view controller before the current view controller appears but can't seem to get it. Basically my app, starts on a splash page and checks if you have a saved NSUserDefaults and if yes it opens the main view controller. However I don't want a user to see that view before seeing the main view when they are already a user, it's not user friendly. I want the a current user to see the launch image and then the main view directly. However I can't really get that done. This is what I have done which produces the undesired effect.</p>
  
  <pre><code>- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];
  NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; NSString *user = [prefs stringForKey:@"userName"];
  
  if(user.length&gt;0){
      NSLog(@"Going straight to main %s", "Yes");
      [self performSegueWithIdentifier:@"startMain" sender:self];
  
    }
  }
  </code></pre>
  
  <p>How an I get around this?</p>