I'm using the following code to obtain scores from a CocosLive high score table.
NSLog(@"Requesting scores...");
CLScoreServerRequest *request = [[CLScoreServerRequest alloc] initWithGameName:@"Serenity" delegate:self];
[request requestScores:kQueryAllTime limit:15 offset:0 flags:kQueryFlagByCountry category:@"Classic"];
NSArray *scores = [request parseScores]; //ERROR HERE
for (id *score in scores)
{
NSLog(@"Score%@", score);
}
// Release. It won't be freed from memory until the connection fails or suceeds
[request release];
I receive an error on the indicated line, informing me that the data could not be parsed. I have discovered that this is because the receivedData variable in CLScoreServerRequest has not been populated, and the method is attempting to parse an empty array.
My question is: After requesting the scores, how do I access the scores. Is there a method I should call to populate the receivedData variable?
Thanks in advance for your help,
James