Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8589359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:02:21+00:00 2026-06-11T23:02:21+00:00

I am building a game in Cocos2d-iPhone, and while I was updating to iOS

  • 0

I am building a game in Cocos2d-iPhone, and while I was updating to iOS 6, I noticed that Apple changed the way Game Center authentication is done, using authenticateHandler instead of authenticateWithCompletionHandler.

I added the new authentication method, but the game now crashes if a player is not already logged in to Game Center. There is no problem authenticating if a user is already logged in.

Here is my code:

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");
        }
    };
}

It seems like it’s crashing when trying to present the Game Center viewController, even though I use the exact same code to present the GKTurnBasedMatchmakerViewController with no issues.

Any help would be much appreciated.

EDIT:
Here is the exception getting thrown on crash:

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:02:23+00:00Added an answer on June 11, 2026 at 11:02 pm

    Here you can find useful information about your crash, I think it is the underlying reason.
    https://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html

    Apps should provide the delegate method application:supportedIntefaceOrientationsForWindow and ensure that portrait is one of the returned mask values.

    I added below code to fix this crash.

    - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
    {
        return UIInterfaceOrientationMaskAllButUpsideDown;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been building a game for a while (nearly done) - But the
I am building a cocos2d continuous running ios game, where a character is animated
I'm currently building a game for the iPhone with cocos2d and have the following
I am building a game using cocos2d-iphone 0.99.4 and Xcode 3.2.4. When I try
I am using Xcode 4.2 and building a game for iphone (from iOS 3.0
I'm building a cocos2d iPhone game with lots of bullets and moving enemies and
I'm currently building an iPhone action/fun-game with cocos2d. It's a 2D tank game where
I'm building a cocos2d game which is supposed to be in portrait mode. I
I just finish my iPhone game using cocos2d, and I want to submit it
I'm creating a building game in JavaScript and PHP that involves a grid. Each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.