4

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 シミュレーターから行われています
  • GameKit は、サンドボックスにログインしたローカル プレイヤーを認証しました
  • 「Standard」という名前のリーダーボードが iTunes Connect に作成されました
  • シミュレーターで Web を閲覧できます

スコアをアップロードするために使用するコードは次のとおりです

    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");
         }
     }];
4

2 に答える 2

2

GKDomainError コード 3 の 1 つの理由 (これが私に影響を与えた理由です) は、GKScore の初期化時に initWithCategory メッセージで指定されたランキング カテゴリ ID が正しく指定されていない場合です。

于 2010-10-14T03:03:28.293 に答える
0

エラーを出力すると、追跡が容易になります。等:

NSLog(@"An error occured reporting the score: %@", error);
于 2010-10-16T16:20:41.200 に答える