游戏中心排行榜错误

时间:2014-04-09 02:40:17

标签: ios objective-c automatic-ref-counting gamekit

我试图让一些排行榜进入我的游戏并且我收到了以下错误:

No visible @interface for 'MGLGameCenterManager' declares the selector 'callDelegateOnMainThread:withArg:error:'

它就在这里,

- (void) authenticateLocalUser
{
if([GKLocalPlayer localPlayer].authenticated)
{
    return;
}

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
 {
     [self callDelegateOnMainThread: @selector(processGameCenterAuthentication:) withArg:
      NULL error: error];
 }];
}

问题是什么?

1 个答案:

答案 0 :(得分:0)

这是我setAuthenticateHandler:

的代码
[GKLocalPlayer localPlayer].authenticateHandler = ^(UIViewController *viewController, NSError *error)
    {   
        if (error)
            NSLog(@"Authentication failed %@", error.localizedDescription);
        else
        {
            if (viewController)
                [[CCDirector sharedDirector] presentViewController:viewController
                                                          animated:YES
                                                        completion:nil];
            else
                [self proccessAuthentification];
        }
    };
相关问题