xcode - Game Center posting bogus scores - iPhone -


i'm trying game center working , it's there. problem scores posted don't make sense. post score code:

-(ibaction)subscore {     {         gkscore *scorereporter = [[[gkscore alloc] initwithcategory:@"katplay"] autorelease];          scorereporter.value = gcpost;         nslog(@"posted");         nslog(gcpost);          [scorereporter reportscorewithcompletionhandler:^(nserror *error) {             if (error != nil)             {                 nslog(@"failed!!!");                 nslog(gcpost);             }         }];     } } 

so play game , score , view console log says gcpost = 2500. when view leaderboard score 100,929,392 points. have no idea number have come from.

am missing basic?

chris

just implemented game center in app. need convert integer onto int64_t. in objective-c terms, thats longlong. can change this:

scorereporter.value = gcpost;

to this:

scorereporter.value = [[nsnumber numberwithint:gcpost] longlongvalue];

i urge read apple documentation on game center. it's quick , easy read. can copy of code out of there well.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -