iPhone GameKit:与Sandbox通信 - GKErrorDomain Code 3

时间:2010-10-13 06:39:58

标签: iphone itunesconnect gamekit

任何人有使用GameKit GKErrorDomain Code 3的经验吗?当我尝试将分数上传到沙盒中的排行榜时,我收到错误消息。 iOS参考库只是说Indicates that an error occurred when communicating with Game Centre这是完整的错误消息:

Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x75e4eb0 {NSUnderlyingError=0x7531e00 "The operation couldn’t be completed. status = 5053", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server

环境:

  • 请求来自4.1 Simulator
  • GameKit已验证登录沙盒的本地玩家
  • 已在iTunes连接
  • 上创建名为“标准”的排行榜
  • 我可以在模拟器中浏览网页

以下是我用来上传分数的代码

    GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"Standard"] autorelease];
    scoreReporter.value = 10;
    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) 
     { 
    if (error != nil) 
         {
             // handle the reporting error
             NSLog(@"An error occured reporting the score");
         }
         else 
         {
             NSLog(@"The score was reported successfully");
         }
     }];

2 个答案:

答案 0 :(得分:2)

GKDomainError Code 3的一个原因(这是影响我的原因)是在初始化GKScore时在initWithCategory消息中指定的排行榜类别ID未正确指定。

答案 1 :(得分:0)

如果您打印出错误,则更容易追踪。 等等:

NSLog(@"An error occured reporting the score: %@", error);