gpt4 book ai didi

objective-c - 游戏中心排行榜中的完成按钮不起作用

转载 作者:搜寻专家 更新时间:2023-10-30 20:02:32 25 4
gpt4 key购买 nike

当我在排行榜 View 中按下完成按钮时,它什么也没做,排行榜仍然可见。

代码如下:

GKGameCenterViewController *gcViewController = [[GKGameCenterViewController alloc] init];

gcViewController.gameCenterDelegate = self;
[gcViewController setDelegate:self ];
if (shouldShowLeaderboard) {
gcViewController.viewState = GKGameCenterViewControllerStateLeaderboards;
gcViewController.leaderboardIdentifier = currentLeaderBoard;
}
else{
gcViewController.viewState = GKGameCenterViewControllerStateAchievements;
}

[self presentViewController:gcViewController animated:YES completion:nil];**

最佳答案

您必须添加关闭 View Controller 的功能(委托(delegate))

-(void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController{
[gameCenterViewController dismissViewControllerAnimated:YES completion:nil];

关于objective-c - 游戏中心排行榜中的完成按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24854717/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com