1
我背後有我的辭職按鈕下面的代碼:辭職在回合制遊戲(遊戲中心)
currentMatch.currentParticipant.matchOutcome = GKTurnBasedMatchOutcomeWon;
nextParticipant.matchOutcome = GKTurnBasedMatchOutcomeLost;
[currentMatch participantQuitInTurnWithOutcome:GKTurnBasedMatchOutcomeLost
nextParticipant:nextParticipant matchData:data
completionHandler:^(NSError *error) {
if (error) {
NSLog(@"%@", error);
}
else {
[statusLabel setString:@"You resigned"];
}];
它說:「你辭職」,但對方沒有給出通知,又是剛傳給他。對手現在不能做任何動作,否則會造成錯誤。完成比賽的唯一方法是讓對手也辭職。
任何人都可以看到上述代碼有什麼問題嗎?