Search code examples
iosxcodegamekitrankleaderboard

Value of [[leaderboard localPlayerScore] rank] if not ranked yet?


For some reason I can't reset my leaderboards to test this, so does anyone know what the value of the rank property of a GKScore object is if the local player isn't ranked yet in the specified leaderboard?


Solution

  • It'll be zero.

    rank

    The position of the score in the results of a leaderboard search. (read-only) @property(nonatomic, readonly, assign) NSInteger rank Discussion

    The value of this property is only valid on score objects returned from Game Center. The rank property represents the position of the score in the returned results, with 1 being the best score, 2 being the second best, and so on. Availability

    Available in iOS 4.1 and later.
    

    Read this doc for more info.