我正在使用 iOS7 。我已经连接了一个高分按钮,所以当你按下它时,它会带你进入游戏的排行榜。它成功地将我带到了排行榜,但是当我按下排行榜右上角的“完成”按钮时,它不会让我回到应用程序。它什么都不做。我怎样才能解决这个问题?这是我的高分按钮方法的代码:
- (IBAction)highscoresButtonPressed:(id)sender
{
GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
[self presentViewController:gameCenterController animated:YES completion:nil];
}
答案 0 :(得分:0)
为完成按钮添加 UIBarButton 操作。
UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneAction)];
void doneAction(){
//pop view controller
}