Search code examples
iosios7game-center

reportAchievementWithCompletionHandler deprecated in iOS7 but replacement not specified


Has anyone found the replacement for

[GKAchievement reportAchievementWithCompletionHandler]?

Typically when things are deprecated the docs indicate a replacement. Not so with this one so far and I wanted to cross this off the list of possible causes of another issue we are seeing.


Solution

  • Was looking for the same info and saw your post, here is what I went with after not finding anything either:

    NSArray *achievements = [NSArray arrayWithObjects:achievement, nil];
    [GKAchievement reportAchievements:achievements withCompletionHandler:^(NSError *error) {
       if (error != nil) {
          NSLog(@"Error in reporting achievements: %@", error);
       }
    }];