当玩家触摸物体时,我有这个代码用于接收分数:
- (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];
}
但是,结果,我的分数显示如下:“Pasc = 123456”,我怎样才能让它显示,个位数增加。(将数字 1 替换为 2,将 2 替换为 3..
谢谢。