Deprecated GKScore Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in iOS 7.0

category

The leaderboard that this score belongs to. (Deprecated in iOS 7.0.)

@property(copy, nonatomic) NSString *category
Discussion

The category string must match an identifier for a leaderboard you created on iTunes Connect.

Availability
  • Available in iOS 4.1 and later.
  • Deprecated in iOS 7.0.
Declared In
GKScore.h

initWithCategory:

Returns an initialized score object. (Deprecated in iOS 7.0.)

- (id)initWithCategory:(NSString *)category
Parameters
category

An identifier for a specific leaderboard you’ve configured on iTunes Connect. Must not be nil.

Return Value

An initialized score object, or nil if an error occurred.

Discussion

Your game explicitly allocates and initializes a score object when it needs to report a new score to Game Center.

Availability
  • Available in iOS 4.1 and later.
  • Deprecated in iOS 7.0.
Related Sample Code
Declared In
GKScore.h

issueChallengeToPlayers:message:

Issues a score challenge to a set of players. (Deprecated in iOS 7.0.)

- (void)issueChallengeToPlayers:(NSArray *)playerIDs message:(NSString *)message
Parameters
playerIDs

An array of NSString objects that contains the player identifiers for the players to challenge.

message

A text message to display to the players.

Discussion

Your game should only issue a challenge request in direct response to a player action. That is, your game should provide a user interface that allows the player to choose to issue a challenge and choose which friends will receive the challenge, and only issue a challenge when the player wishes to do so.

Availability
  • Available in iOS 6.0 and later.
  • Deprecated in iOS 7.0.
Declared In
GKChallenge.h

reportScoreWithCompletionHandler:

Reports a score to Game Center. (Deprecated in iOS 7.0.)

- (void)reportScoreWithCompletionHandler:(void (^)(NSError *error))completionHandler
Parameters
completionHandler

A block to be called after the score is reported.

The block receives the following parameter:

error

If an error occurred, this parameter holds an error object that describes the problem. If the score was successfully reported, this parameter’s value is nil.

Discussion

The value property must be set before calling this method.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

Availability
  • Available in iOS 4.1 and later.
  • Deprecated in iOS 7.0.
Related Sample Code
Declared In
GKScore.h