Hi. I've managed to post new scores, but when I retrieve them, I end up with an invalid string. Here's my request delegate:
-(void) scoreRequestOk: (id) sender
{
NSLog(@"score request OK");
int it;
NSArray *scores = [sender parseScores];
NSDictionary *nd=[scores objectAtIndex:0];
it=[[nd objectForKey:@"position"] intValue];
if(it>-1 && it<10) {
globalHighScores[it].name=[nd objectForKey:@"cc_playername"];
NSLog(globalHighScores[it].name);
globalHighScores[it].hiSc=[[nd objectForKey:@"cc_score"] intValue];
}
}
The console at this point shows the correct name at index [0], but then when I try to display it or save it, I get a EXC_BAD_ACCESS, and globalHighScores[0].name shows as 'Invalid'. Here's the global def for globalHighScores:
typedef struct _highScores {
NSString *name;
int hiSc;
} highScores;
highScores globalHighScores[11];
Am I doing it wrong?
Thanks in advance :)