0

I'm using this method to load all achievements description.

[GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler:
 ^(NSArray *descriptions, NSError *error) {
     CCLOG(@"achivements loaded");
     if (error != nil) {
         NSLog(@"Error %@", error);

 } else {
     if (descriptions != nil){
         CCLOG(@"nb %i",descriptions.count);
         for (GKAchievementDescription* a in descriptions) {
             CCLOG(@"image %@ %@ %@", a.title, a.achievedDescription, a.image);
             [achievementsDescDictionary setObject: a forKey: a.identifier];
         }
     } else {
         CCLOG(@"descriptions empty");
     }
     }
 }];

I always get a.image = null.

Thanks.

Benoît Freslon
  • 2,021
  • 4
  • 26
  • 35

2 Answers2

1

Actually you can't load images from Game Center.

Just add your achievements Images into your project and use this method with GKAchievementHandler

- (void)notifyAchievementTitleAndImage:(NSString *)title andMessage:(NSString *)message withImage:(UIImage *)image 
Benoît Freslon
  • 2,021
  • 4
  • 26
  • 35
0

if you can't load the images from game center then what about to create a plist file for mapping "achievements-images"? I used this technique for my game which is similar to 3-in-row to define various types of blocks

Gargo
  • 1,135
  • 1
  • 10
  • 21