簡體   English   中英

錯誤:您不是當前參與者。 當我是當前的參與者。 什么?

[英]ERROR: You are not the current participant. When I am the current participant. What?

我正在開發一款基於回合制的iOS游戲,我遇到了一個奇怪的錯誤。 它說當我確實證實我確實是當前的參與者時,我不是當前的參與者。 在這里,我檢查我是否是當前的參與者,並輸出“Equal”,但是當我試圖結束輪到時它說“錯誤:你不是當前的參與者”。

if ([match.currentParticipant.playerID 
isEqualToString:GKLocalPlayer.localPlayer.playerID])
    {
        NSLog(@"Equal");
        }
        else
        {
            NSString* stringA, *stringB;
            stringA = @"Current Participant %@", match.currentParticipant;
            stringB = @"Me: %@", GKLocalPlayer.localPlayer.playerID;
            NSLog(stringA);
            NSLog(stringB);
        }
        // Pack up the game data.
        NSData* gameData = [NSKeyedArchiver archivedDataWithRootObject:game];
        [self endTurnWithMatch:game.match AndData:gameData];
    }

這到底是怎么回事!?

我是一個白痴。 在我的“endTurnWithMatch”函數中,我的“ERROR”以某種方式逃脫了我的else塊並且每次運行該函數時都在執行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM