应用程序崩溃游戏中心身份验证

时间:2012-08-02 03:09:10

标签: iphone objective-c ios game-center

我似乎在这里不知所措。当我打开我的应用程序,并且Game Center应用程序已注销时,我的应用程序崩溃了,但是当Game Center登录时,它运行正常。这是我正在使用的代码。我做错了吗?

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
        if (error == nil) {
            // Insert code here to handle a successful authentication.
            //gcSuccess = YES;
        }
        else
        {
            // Your application can process the error parameter to report the error to the player.
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Could not connect with Game Center servers." delegate:nil cancelButtonTitle:@"Try Later" otherButtonTitles:nil];
             [alert show];
        }
    }];

此外,这是我在应用程序崩溃时看到的唯一错误,我只在控制台中看到此错误,而不是在运行日志中。

Aug  1 20:15:08 Zachary-Christopouloss-iPhone backboardd[52] <Warning>: BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)

对此的任何帮助都会很棒。非常感谢!

1 个答案:

答案 0 :(得分:0)

相信你应该在认证之前检查[GKLocalPlayer localPlayer].isAuthenticated ...这不应该影响它,但是如果你跳过,那里可能会发生一些生气它?

相关问题