i have this code for receiving score when Player touch an object:
- (void) match:(GKMatch *)match
didReceiveData:(NSData *)data
fromPlayer:(NSString *)playerID{
NSString *incomingDataAsString =
[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
NSString *existingText = score.text;
NSString *finalText =
[existingText stringByAppendingFormat:@"Pasc = %@",
incomingDataAsString];
[self.score setText:finalText];
[incomingDataAsString release];
}
But, as result, my score shows like that: “Pasc = 123456”, how can I make it to show, single digit increasing. (Replacing number 1 with 2, and 2 with 3..
Thanks.
Please try the following, hope it help.
I forgot that we can do like this, you mentioned that, just remove “Pasc =”, and concern only @”%@”, then just
Please give me a feedback, so I understand what’s happen, then I can edit my code to help you :), thanks.