Вопрос

I have a rather disturbing problem. When I unlock an achievement, I show a notification about it. It is triggered when achievement.completed == YES. On the Simulator, this is ok, achievement.completed is true and the notification shows. However, on any device this is false and no notification is shown! I use the same code, nothing changes, I don't have any #ifdef's for Simulator.

Code:

if (achievement.completed) {
    [self showAchievementNotification: [_achievementDescriptions objectForKey:achievement.identifier]];
}

I modified the code, so it works now:

if (achievement.percentComplete >= 100.0f && percentComplete == achievement.percentComplete) {
    [self showAchievementNotification: [_achievementDescriptions objectForKey:achievement.identifier]];
}

This works perfectly.

Это было полезно?

Решение

I managed to figure out another way. I edited the question, the last code snippet has the anwser.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top