I tried to present leaderboards via this code block
if ([GKLocalPlayer localPlayer].isAuthenticated) {
GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
if (gameCenterController != nil)
{
gameCenterController.gameCenterDelegate = self;
gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
UIViewController *vc = self.view.window.rootViewController;
[vc presentViewController: gameCenterController animated:YES completion:Nil];
}
}else{
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"You must enable Game Center"
message:@"Sign in through the Game Center app to enable all features"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[message show];
}
And if I enabled all exception breakpoints, it will crash in the moment leaderboards are presented. When i delete this breakpoints, everything works fine. I am login into Game Center with test user. Is this a glitch or what ?
I solved it via editing exception breakpoint from all to Objective-C exceptions . Tnx @LearnCocos2D for the answer