0

我试图通过这个代码块展示排行榜

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];
    }

如果我启用了所有异常断点,它会在排行榜出现的那一刻崩溃。当我删除这个断点时,一切正常。我正在使用测试用户登录游戏中心。这是一个小故障还是什么?

4

1 回答 1

0

我通过编辑从 all 到 Objective-C exceptions 的异常断点来解决它。Tnx @LearnCocos2D 的答案

于 2014-05-17T16:50:14.393 回答