Reputation: 281
How to get game center achievements description into NSString?
Upvotes: 1
Views: 629
Reputation: 1086
Apple makes it very nice for you with this simple block method:
- (void) retrieveAchievmentMetadata {
[GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler:
^(NSArray *descriptions, NSError *error) {
if (error != nil)
// process the errors
if (descriptions != nil)
// use the achievement descriptions.
}];
}
You can then extract the NSStrings from the descriptions array.
There is more documentation on this topic here: http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/GameKit_Guide/Achievements/Achievements.html
I hope this helps!
Upvotes: 2