0

如何使标签显示为:“大约 30 分钟”,其中 NSString“scoreString”的值为 30?

这是我必须单独显示字符串的内容:

NSString *scoreString = [[score objectForKey:@"score"] stringValue];
testLabel.text = scoreString;

我只需要一种方法来编写“关于”,然后是 scoreString,然后是“分钟”。

4

1 回答 1

3

You just need to create a new string which combines each component. There are a few ways to do it, but this is probably the easiest:

testLabel.text = [NSString stringWithFormat:@"about %@ minutes", scoreString];
于 2013-07-04T03:01:27.117 回答