Search code examples
iphoneios4iphone-sdk-3.0ios-simulatorcocos2d-iphone

game center score submission problem


i have integrate game center in my game ...and its working well but i have i new problem now :P only one score is submit of user .. after that no score submit even its greater then posted score or less... any idea what i have to exactly doo... Regards Haseeb


Solution

  • i use this to submit score......after being sure that the game center is available...

    NSAutoreleasePool   *pool = [[NSAutoreleasePool alloc]init];
    
        GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:gameCenterCategory] autorelease];
    
        int64_t score1 =socre;
        scoreReporter.value = score1;
        [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) { 
            if (error != nil) {
                NSLog(@"Submit failed");
            }
            else {
                NSLog(@"Score Submited");
            }
        }];
    
        [pool release];