0

I am using iOS7. I have connected a highscore button so when you press it, it takes you to the leaderboard for the game. It successfully takes me to the leaderboard, however when I press the "Done" button on the top right of the leaderboard, it does not take me back to the app. It does nothing at all. How can I fix this? Here is my code for my highscore button method:

- (IBAction)highscoresButtonPressed:(id)sender
{
    GKGameCenterViewController* gameCenterController = [[GKGameCenterViewController alloc] init];
    gameCenterController.viewState = GKGameCenterViewControllerStateLeaderboards;
    [self presentViewController:gameCenterController animated:YES completion:nil];
}
user3614030
  • 481
  • 6
  • 16

1 Answers1

0

Add a UIBarButton action for the done button.

UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneAction)];

void doneAction(){ //pop view controller }

NorCalKnockOut
  • 870
  • 3
  • 10
  • 26