GPGLeaderboardController Class Reference

GPGLeaderboardController Class Reference

Overview

A view controller that displays the scores for a specific leaderboard.

This controller must be displayed modally from another view controller. Once displayed, this controller will show a table view that contains all of the leaderboard's scores.

The user may dismiss the controller by tapping a "Done" button. When this occurs the leaderboardViewControllerDidFinish: method will be called on the leaderboardDelegate. Within this method you should dismiss the modal view controller.

Example presentation of a GPGLeaderboardController:

GPGLeaderboardController* lc = [[[GPGLeaderboardController alloc] initWithLeaderboardId:@"12345"] autorelease];
lc.leaderboardDelegate = self;
[self.rootController presentModalViewController:lc animated:YES];

Example implementation of GPGLeaderboardControllerDelegate:

- (void)leaderboardViewControllerDidFinish:(GPGLeaderboardController *)viewController {
  [self.rootController dismissModalViewControllerAnimated:YES];
}

Public Member Functions

Initialization
(id) - initWithLeaderboardId:
 Initializes a newly allocated leaderboard controller with a given leaderboard identifier.

Properties

Properties
GPGLeaderboardTimeScope timeScope
 The time scope that the leaderboard should filter on.
id
< GPGLeaderboardControllerDelegate
leaderboardDelegate
 The delegate through which the user will dismiss the controller.

Member Function Documentation

- (id) initWithLeaderboardId: (NSString *)  leaderboardId

Initializes a newly allocated leaderboard controller with a given leaderboard identifier.

This is the designated initializer. Designated initializer.


Property Documentation

- (GPGLeaderboardTimeScope) timeScope [read, write, assign]

The time scope that the leaderboard should filter on.

Set this value before presenting the controller in order to set the initial time scope.

You should store this value when the leaderboard controller is dismissed and restore it when the controller is presented again.

The default value is: GPGLeaderboardTimeScopeAllTime Default: GPGLeaderboardTimeScopeAllTime

The delegate through which the user will dismiss the controller.