if(myScoreValue.value==300)//achievement for getting 300 points.
{
GKAchievement *achievement= [[GKAchievement alloc] initWithIdentifier:@"Score4"];
achievement.percentComplete = 100.0;
achievement.showsCompletionBanner=YES;
if(achievement!= NULL)
{
[achievement reportAchievementWithCompletionHandler: ^(NSError *error)
{
if(error != nil){
NSLog(@"Achievement failed");
} else {
NSLog(@"Achievement Success");
}
}];
}
}
當用戶得到剛好300的分數時,他們得到了一個成就,但是如果他們超過300,它就不能工作。我該如何解決?gamecenter沒有得到結果
請把'在每一個句子的結尾.'。 – vikingosegundo
除了可能的問題? –
更多細節可能會有所幫助;你什麼時候運行這段代碼?也許它運行頻繁? –