2014-06-14 5 views
0

내 게임의 점수를 Gamecenter에 업로드하려고하는데 오류가 발생하지 않고 코드를 작성할 수 없습니다. 또한 reportScores에 대한 클래스 메소드는 없습니다 (점수)합니다. Gamecenter Class에 구현하는 방법을 잘 모르겠습니다.ReportScore GameCenter 메서드를 찾을 수 없음

-(void) reportScore: (int64_t) score forLeaderboardID: @"tap_amateur" identifier 

{ 

    GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier:@"tap_amateur"]; 

    scoreReporter.value = score; 

    scoreReporter.context = 0; 



    NSArray *scores = @[scoreReporter]; 

    [GKLeaderboard reportScores:scores withCompletionHandler:^(NSError *error) { 


    }]; 

} 

@end 

답변

0

한번에 변경 :

[GKLeaderboard reportScores:scores withCompletionHandler:^(NSError *error) { 


}]; 

에 :

[GKLeaderboard reportScoreWithCompletionHandler: 
    ^(NSError* error) { 

     [self setLastError:error]; 

     BOOL success = (error == nil); 

     if ([_delegate 
       respondsToSelector: 
       @selector(onScoresSubmitted:)]) { 

      [_delegate onScoresSubmitted:success]; 
     } 
    }]; 
관련 문제