Setting a Default Leaderboard

With the release of iOS 5.0 Apple has added just one method to Game Center leaderboards. You now have the ability to set a default leaderboard for the local user. If you set a default leaderboard you can omit setting a category for a leaderboard when submitting and it will default to the correct one. The following method will take an NSString identifier as an argument for the leaderboard that you would like to specify as the default for the local player.

[GKLeaderboard setDefaultLeaderboard:@"com.dragonforged.leaderboardToBeDefault"images  withCompletionHandler:^(NSError *error)       { NSLog(@"An error occurred when setting ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.