3

ターンベースのゲームに iOS 6 Game Center API を使用しています。

デバイスがインターネットから切断されたとき メソッドの完了ハンドラ内

[currentMatch endTurnWithNextParticipant:nextParticipant matchData:data completionHandler:^(NSError *error) {
        if (error) {
            NSLog(@"%@", error);

        } else {
            //save the new state of the game
        }

エラーが発生します。すると、対戦リストを表示するゲームセンター標準のUIでは「自分の番」と表示されます。再度接続すると「あなたの番」に変わります。

http://www.raywenderlich.com/5509/beginning-turn-based-gaming-with-ios-5-part-2の有名なチュートリアルのコードには、まったく同じ問題があります。

この問題をどのように処理すればよいですか?

4

2 に答える 2

4

iOS 6 Game Center API を使用している場合は、使用する必要があります

-endTurnWithNextParticipants:turnTimeout:matchData:completionHandler:

なぜなら...

–endTurnWithNextParticipant:matchData:completionHandler: Deprecated in iOS 6.0

http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKTurnBasedMatch_Ref/Reference/Reference.html

于 2012-12-07T17:09:00.993 に答える