Awaria Game Center iOS 6 podczas uwierzytelniania

Buduję grę w Cocos2d-iPhone i podczas aktualizacji do iOS 6 zauważyłem, że Apple zmieniło sposób uwierzytelniania Game Center, używającauthenticateHandler zamiastauthenticateWithCompletionHandler.

Dodałem nową metodę uwierzytelniania, ale gra ulega awarii, jeśli gracz nie jest już zalogowany do Game Center. Nie ma problemu z uwierzytelnieniem, jeśli użytkownik jest już zalogowany.

Oto mój kod:

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0"))
{
    GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
    localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error)
    {
        if (viewController != nil)
        {
            AppController *appDelegate = (AppController*)[UIApplication sharedApplication].delegate;

            [delegate.viewController presentViewController:viewController animated:YES completion:nil];
        }
        else if (localPlayer.isAuthenticated)
        {
            NSLog(@"Player authenticated");
        }
        else
        {
            NSLog(@"Player authentication failed");
        }
    };
}

Wygląda na to, że zawiesza się przy próbie przedstawienia kontrolera widoku Game Center, mimo że używam dokładnie tego samego kodu do prezentacjiGKTurnBasedMatchmakerViewController bez problemów.

Każda pomoc byłaby bardzo mile widziana.

EDYCJA: Oto wyjątek, który został rzucony podczas awarii:

Uncaught Exception UIApplicationInvalidInterfaceOrientation: Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES

questionAnswers(2)

yourAnswerToTheQuestion