Note that there are some explanatory texts on larger screens.

plurals
  1. POxcode "Done Button" GameCenter doesn´t do anything
    primarykey
    data
    text
    <p>this is my first app including the gamecenter, and i have a little problem with it. i implemented some code i found in the net that should work. Everything works fine, except for "done button" :(</p> <p>.m</p> <pre><code> #import &lt;GameKit/GameKit.h&gt; - (void)viewDidLoad { [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { if (error == nil) NSLog(@"Authentication Successful!"); else NSLog(@"Authentication Failed!"); }]; -(IBAction)subscore{ GKScore *scoreReporter = [[GKScore alloc] initWithCategory:@"lrhseasy"]; scoreReporter.value = score; [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) { if (error != nil) { NSLog(@"Submitting a score failed!"); } else { NSLog(@"Submitting succeeded!"); } }]; } -(IBAction)showLeader{ GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc]init]; if (leaderboardController != nil) { //leaderboardController.leaderboardDelegate = self; [self presentModalViewController:leaderboardController animated:YES]; } } - (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController { NSLog(@"Close leaderboard"); [self dismissModalViewControllerAnimated:YES]; [viewController.view.superview removeFromSuperview]; } </code></pre> <p>The last function isn´t called, when the done button is pressed - i don´t get "close leaderboard" in the debug console.</p> <p>After searching for 3 hours, the only thing i found was "<strong>Did you add GKLeaderboardViewControllerDelegate to the list of protocols that this class implements?</strong> " but i do not know what this means or how its done :( </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload