有没有办法重置我的GameCenter沙盒帐户的成就进度?

时间:2012-02-17 10:02:22

标签: sandbox reset game-center achievements

我有一个GameCenter Sandbox-Account测试了我的游戏,获得了成就等。 现在我做了一些改变,想再次测试收入成就!

我是否必须制作一个全新的沙盒帐户,或者有办法重置我的帐户?

2 个答案:

答案 0 :(得分:12)

以下代码来自Apple Documentation

- (void) resetAchievements
{
   // Clear all locally saved achievement objects.
   achievementsDictionary = [[NSMutableDictionary alloc] init];
   // Clear all progress saved on Game Center
   [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error)
   {
      if (error != nil)
      // handle errors
   }];
}

另请参阅Apple的示例项目GKTapper

答案 1 :(得分:0)

// Reset all the achievements for local player 
- (void)resetAchievements
{
    [GKAchievement resetAchievementsWithCompletionHandler: ^(NSError *error) 
     {
        if (!error) {
             [storedAchievements release];
            storedAchievements = [[NSMutableDictionary alloc] init];

            // overwrite any previously stored file
             [self writeStoredAchievements];              
        } else {
            // Error clearing achievements. 
         }
     }];
}