November 2011
Beginner
238 pages
6h 19m
English
There are circumstances when you might want to reset user achievements. Besides being extremely helpful in debugging, you might find it useful to provide users with an option to reset. You might want to add a prestige mode or give the users a chance to start your game over from the beginning. The following code snippet will completely reset all achievements in your app for the local user.
- (void)resetAchievements
{
[self setEarnedAchievementCache:NULL];
[GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) {
if (error == NULL) {
NSLog(@"Achievements have been reset");
} else {
NSLog(@"There was an error in resetting the achievements: %@", [error localizedDescription]); ...