Game Development Reference
In-Depth Information
}
}];
The loadAchievements method uses the GKAchievement class's
loadAchievementsWithCompletionHandler method to retrieve the local
player's achievements from Game Center ( Listing 14-16 ).
Listing 14-16 . Loading the Local Player's Achievements
-(void) loadAchievements
{
[GKAchievement loadAchievementsWithCompletionHandler:←
^(NSArray* loadedAchievements, NSError* error)
{
[self setLastError:error];
if (achievements == nil)
{
achievements = [[NSMutableDictionary alloc] init];
}
else
{
[achievements removeAllObjects];
}
for (GKAchievement* achievement in loadedAchievements)
{
[achievements setObject:achievement
forKey:achievement.identifier];
}
if ([delegate respondsToSelector:@selector(onAchievementsLoaded:)])
{
[delegate onAchievementsLoaded:achievements];
}
}];
}
 
 
Search Nedrilad ::




Custom Search