0

我似乎在这里不知所措。当我打开我的应用程序并注销 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)

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

4

1 回答 1

0

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

于 2012-08-02T03:17:51.197 回答