objective-c - 游戏中心验证错误

标签 objective-c cocoa-touch game-center

我正在尝试调用游戏中心的身份验证方法,但是没有出现身份验证屏幕并且回调返回错误:“请求的操作已被取消”。

代码:

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
     {
        NSDictionary *userInfo = nil;
        if (error == nil) {

            NSLog(@"Game Center successfully authenticated");
        }
        else {
            userInfo = [NSDictionary dictionaryWithObject:error forKey:@"NSError"];
        }
        [[NSNotificationCenter defaultCenter] postNotificationName:Notification
                                                            object:self
                                                          userInfo:userInfo];

    }];

知道是什么导致了这个问题吗?

最佳答案

在 iOS 4.2 中,当用户取消登录 Game Center 时,在尝试 3 次后返回错误。您可以通过使用 Game Center 应用程序登录来解决错误,然后再次尝试您的应用程序,您应该会在您的应用程序中看到来自 Game Center 的欢迎返回消息

关于objective-c - 游戏中心验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4386321/

相关文章:

iphone - uitableview numberOfRowsInSection 计数

iOS 7 - 在某些 View 上隐藏状态栏

ios - 如何拍摄照片然后将 iOS 应用程序最小化?

ios - 更改 UITableView 部分标题的默认滚动行为

iphone - iOS 游戏玩家 ID

iphone - 检查数组是否包含特定索引处的元素?

objective-c - 通过 HockeyApp 更新应用程序后启动时应用程序崩溃

iphone - 禁用屏幕上当前 View 的用户交互

ios - 如何使用 swift (iOS) 从特定的 gamecenter 排行榜中获取前 10 名的分数

ios - 如何显示所有可用的 Game Center 排行榜,而不是自动显示默认排行榜?