Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6109375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:23:51+00:00 2026-05-23T14:23:51+00:00

I am trying to submit a float of two decimal length to my Game

  • 0

I am trying to submit a float of two decimal length to my Game Center leaderboard, however the only format allowed to submit with is int64_t. I am using the default Apple report score method:

- (void)reportScore:(int64_t)score forCategory:(NSString *)category {
    GKScore *scoreReporter = [[GKScore alloc] initWithCategory:category];   
    scoreReporter.value = score;
    [scoreReporter reportScoreWithCompletionHandler: ^(NSError *error) {
        [self callDelegateOnMainThread: @selector(scoreReported:) withArg: NULL error: error];
    }];
}

I am trying to use this method to provide the score to the report score method:

- (IBAction)increaseScore {
    self.currentScore = self.currentScore + 1;
    currentScoreLabel.text = [NSString stringWithFormat: @"%lld", self.currentScore];
    NSLog(@"%lld", self.currentScore);
}

Please help, I have been googling like crazy and cannot find the answer to this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:23:52+00:00Added an answer on May 23, 2026 at 2:23 pm

    You can only submit 64 bit integers as scores to a leaderboard. From the documentation:

    To Game Center, a score is just a
    64-bit integer value reported by your
    application. You are free to decide
    what a score means, and how your
    application calculates it. When you
    are ready to add the leaderboard to
    your application, you configure
    leaderboards on iTunes Connect to tell
    Game Center how a score should be
    formatted and displayed to the player.
    Further, you provide localized strings
    so that the scores can be displayed
    correctly in different languages. A
    key advantage of configuring
    leaderboards in iTunes Connect is that
    the Game Center application can show
    your game’s scores without you having
    to write any code.

    That doc page should tell you about formatting your score. It sounds like in order to display float-like scores you will have to tinker with the format settings in iTunes Connect.

    Update

    Try this for increaseScore:

    - (IBAction) increaseScore {      
         self.currentScore = self.currentScore + 5; 
         float score = (float)self.currentScore / 100.0f;
         currentScoreLabel.text = [NSString stringWithFormat: @"%f", score]; 
         NSLog(@"%lld", self.currentScore);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to submit my Ajax form using jQuery. However calling the submit() function
I've been trying to submit a form with the FormPanel using the Action class
I'm trying to submit a few forms through a Python script, I'm using the
Iam trying to submit values to an external DB using http request My code
I am trying to submit a form using Ajax.Updater and have the result of
Im trying to submit a specific form programatically, but I allways get the initial
I'm trying to submit a virtual pageview to track events within application, that may
I'm trying to submit a form with javascript. Firefox works fine but IE complains
I am trying to submit a form with method GET and action index.php?id=3. The
I'm trying to submit a form on an .asp page but Mechanize does not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.