title: Not presenting Authentication view controller game kit ios 7
body: <p>I am on ios 7 and with this code:</p>
  
  <pre><code>-(IBAction)authenticateLocalPlayerWithViewController
  {
  
      GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
      __weak GKLocalPlayer *blockLocalPlayer = localPlayer;
      localPlayer.authenticateHandler = ^(UIViewController *receivedViewController, NSError *error){
  
          if (receivedViewController != nil)
          {
  
              [self presentViewController:receivedViewController animated:YES completion:nil];
  
          } else if (blockLocalPlayer.isAuthenticated) {
  
              signinButton.hidden = YES;
              leaderboardButton.alpha = 1.0;
              leaderboardButton.enabled = YES;
              achievementsButton.alpha = 1.0;
              achievementsButton.enabled = YES;
  
  
              NSString *identifier;
              [self reportAchievement1Identifier:identifier percentComplete:((interactiveHighscore/10000)*100.0)];
              [self reportAchievement2Identifier:identifier percentComplete:((interactiveHighscore/100000)*100.0)];
              [self reportAchievement3Identifier:identifier percentComplete:((interactiveHighscore/1000000)*100.0)];
              [self reportAchievement4Identifier:identifier percentComplete:((interactiveHighscore/100000000)*100.0)];
              [self reportAchievement5Identifier:identifier percentComplete:((allCoins/100000)*100.0)];
  
              [self submitMyInteractiveScore];
              [self submitMyNormalScore];
  
              BOOL isRunMoreThanOnceGC = [[NSUserDefaults standardUserDefaults] boolForKey:@"isRunMoreThanOnceGC"];
              if (!isRunMoreThanOnceGC) {
  
                  UIAlertView *alert = [[UIAlertView alloc]
                                        initWithTitle:@"Game Center Sign In Gift"
                                        message:@"Thanks for signing in with game center here is 50 Coins."
                                        delegate:nil
                                        cancelButtonTitle:@"Thanks!."
                                        otherButtonTitles:nil];
                  [alert show];
  
                  allCoins = [[NSUserDefaults standardUserDefaults] integerForKey:@"allCoins"];
                  allCoins += 50;
  
                  [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isRunMoreThanOnceGC"];
                  [[NSUserDefaults standardUserDefaults] synchronize];
  
  
              }
          } else {
  
              signinButton.hidden = NO;
  
              UIAlertView *alert = [[UIAlertView alloc]
                                    initWithTitle:@"Game Center Not Available"
                                    message:@"Uh Oh! Seems there was an error trying to sign in for Game Center. Try logging in through the Game Center app."
                                    delegate:nil
                                    cancelButtonTitle:@"Ok, Thanks."
                                    otherButtonTitles:nil];
              [alert show];
  
          }
  
          NSLog(@"Error: %d", [error code]);
      };
  }
  </code></pre>
  
  <p>am trying to authenticate the user. First on the root controller's viewDidLoad I call it with this:</p>
  
  <pre><code>//get game center
  LeaderboardsViewController *LVC = [[LeaderboardsViewController alloc] init];
  [LVC authenticateLocalPlayerWithViewController];
  </code></pre>
  
  <p>Then I get this: </p>
  
  <p>Error: 0
  Warning: Attempt to present  on  whose view is not in the window hierarchy!</p>
  
  <p>So I try to press the button in the gamecenterviewcontroller class (thats where the authenticate method is) and I get nothing. Nothing in the log and nothing appears....</p>
  
  <p>Running ios 7 GM Build.</p>
  
  <p>Thanks a lot!</p>