我正在尝试调用游戏中心的身份验证方法,但是没有出现身份验证屏幕并且回调返回错误:“请求的操作已被取消”。
代码:
[[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/