iCulture forum | iPhone, iPad,  iPod touch, Apple TV en iOS

iCulture forum | iPhone, iPad, iPod touch, Apple TV en iOS (https://forum.iculture.nl/)
-   Ontwikkelen voor iOS (https://forum.iculture.nl/f133/development/f58/ontwikkelen-voor-ios/)
-   -   Score add in game center (https://forum.iculture.nl/f133/development/f58/ontwikkelen-voor-ios/109041-score-add-game-center.html)

nathanchunkie 06-01-12 20:53

Score add in game center
 
Hallo,

In de Sandbox mode test ik momenteel de game center in mijn applicatie. Maar het uploaden van mijn score werkt helaas (nog) niet. Weet iemand misschien wat het probleem is? Of kan je in Sandbox mode geen score aan de highscore toevoegen?


Code:

- (IBAction) subScore{

    GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"1234567"];
    scoreReporter.value = counter;

      [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) {
        if (error != nil)
        {
          NSLog(@"Failed: %i",counter); 
        } else {
            NSLog(@"Succes: %i",counter); 
        }
    }];

}

Viewdidload:

Code:

- (void)viewDidLoad
{
    [super viewDidLoad];



    [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
        if (error == nil) {
              NSLog(@"Succes (viewdidload) %i",counter);
        } else {
              NSLog(@"Fail (viewdidload) %i",counter);
        }
    }];

}

The NSlogs outputs;

2012-01-06 08:46:03.804 iTouchers[313:707] Succes (viewdidload) 26

2012-01-06 08:45:52.203 iTouchers[313:707] Succes 26


Alle tijden zijn GMT +2. Het is nu 05:23.