GKLeaderboard in SpriteKit?

96 views Asked by At

How can I use a GKLeaderboard in SpriteKit ?

When I try to present a Leaderboard a got this issue.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x17017fb00'

First throw call stack:
(0x18df0ef50 0x19a4181fc 0x18df13c04 0x18df11930 0x18de315dc 0x100069e00 0x190ed8670 0x190ed83f4 0x190fccd08 0x18df13700 0x18de2ceec 0x1911d5ee4 0x18ed278dc 0x18df13700 0x18de2ceec 0x19a9f0014 0x19a9effd4 0x19a9f31dc 0x18decec2c 0x18deccf6c 0x18de0dc20 0x193af5c0c 0x190f3efdc 0x1000dcb34 0x19aa0baa0)
libc++abi.dylib: terminating with uncaught exception of type NSException**

My Method to show the leaderboard:

-(void) showLeader
{
    GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
    if (leaderboardController != nil)
    {
        leaderboardController.leaderboardDelegate = self;
        [self presentModalViewController:leaderboardController animated:YES];

    }
}

Thanks in advance!

1

There are 1 answers

0
Mobile Ben On BEST ANSWER

presentModalViewController was deprecated in iOS 6. GKLeaderbardViewController is deprecated in iOS 7.

You an refer to this:

What should I use instead of deprecated GKLeaderboardViewController in iOS7?