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

  • SEARCH
  • Home
  • 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 9207311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:21:36+00:00 2026-06-18T00:21:36+00:00

I have a problem with the integration of game center in my app’ which

  • 0

I have a problem with the integration of game center in my app’ which use iOS 6 SDK.
In fact I use the sample code from Apple, but it looks like incomplete :

I have tried this code :

-(void) authenticateLocalPlayer {

GKLocalPlayer* localPlayer =
[GKLocalPlayer localPlayer];

localPlayer.authenticateHandler =
^(UIViewController *loginVC,
  NSError *error) {

    [self setLastError:error];

    if ([GKLocalPlayer localPlayer].authenticated)
    {
        // authentication successful
        [self enableGameCenterForPlayer:[GKLocalPlayer localPlayer]];
    }
    else if (loginVC)
    {
        // player not logged in yet, present the vc
        [self pauseGame];
        [self presentLoginVC:loginVC];
    }
    else
    {
        // authentication failed, provide graceful fallback
        [self disableGameCenter];
    }
    };

}

But the problem is that enableGameCenterForPlayer, pauseGame, presentLoginVC, disableGameCenter are not implemented methods, and it returns :

Instance method '-enableGameCenterForPlayer:' not found (return type defaults to 'id')

How can I fix this problem ?

Thanks

  • 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-18T00:21:37+00:00Added an answer on June 18, 2026 at 12:21 am

    I use the method [self presentLoginVC:VC] to pass my UITabViewController or UINavigationController the viewController because the block below is not on the main thread.

    localPlayer.authenticateHandler = ^(UIViewController *loginVC, NSError *error) {
    

    When you are in a block you should be sure not to change UI elements because you really don’t know when it will complete or where you will be in your app. There are probably many ways to do this, but this is my solution.

    Below is my UITabBarController ‘category’ .m file (additions of methods for a class without subclassing) I create the method presentLoginVC and just have it call ‘showGameCenterViewController’ through my UITabBarController:

        #import "UITabBarController+GameKitAdditions.h"
    
        @implementation UITabBarController (GameKitAdditions)
    
        -(void) showGameCenterViewController: (UIViewController *)VC {
            [self presentViewController:VC animated:NO completion:nil];
        }
    
        -(void)dismissGameCenterViewController:(UIViewController *)VC {
            [self dismissViewControllerAnimated:YES completion:nil];
        }
        @end
    

    As to the other functions:

        -(void) enableGameCenterForPlayer:(GKLocalPlayer *) localPlayer;
        -(void) disableGameCenter;
        -(void) pauseGame;
    

    They could be as simple as just setting a BOOL called enableGameCenter to YES or NO. To get around errors you can just add these prototypes to your .h file and then write the functions just to output something to NSLog() or something.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with linkedin integration in my app. I have created own
I have a problem with an integration test I am writing. I need to
I have problem with UIWebView delay when the load image from url. In my
I have a text log from a game with (for example) two types of
We have a problem with our web methods Integration servers and when we perform
I have a problem with integration BjyAuthorize and Zend navigation and don't know how
I'm new in Spring Framework (2.5.6) and I have Hibernate integration problem on Glassfish
I have a problem about i18n-codeigniter integration. I integrated i18n my last project today.
I have a problem with integration between CouchRest and Sunspot. When I search the
I have to solve the following convolution related numerical integration problem in R or

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.