我正在开发一款回合制 iOS 游戏,但遇到了一个奇怪的错误。当我实际验证我确实是当前参与者时,它说我不是当前参与者。 在这里,我检查我是否是当前参与者,这会输出“相等”,但是当我尝试结束我的回合时,它会显示“错误:您不是当前参与者。”
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 block ,并且在我每次运行该函数时都在执行。
关于iphone - ERROR : You are not the current participant. 当我是当前参与者时。什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16891709/