Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使标签显示为:“大约 30 分钟”,其中 NSString“scoreString”的值为 30?
这是我必须单独显示字符串的内容:
NSString *scoreString = [[score objectForKey:@"score"] stringValue]; testLabel.text = scoreString;
我只需要一种方法来编写“关于”,然后是 scoreString,然后是“分钟”。
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];