NSString中的iphone变量

时间:2010-07-11 03:41:49

标签: iphone objective-c xcode nsstring

我需要定义一个字符串,其中包含一个更改的字符串(我已经可以更改该字符串)和其他文本。

例如,

NSString *commentsAddress = *somestring*/#comments;

现在我知道它可能更像是

NSString *commentsAddress = @"%@/#comments", *somestring*;

但我不能让它发挥作用。

1 个答案:

答案 0 :(得分:0)

NSString *comment = @"This is the comment";
NSString *commentAddress = [NSString stringWithFormat: @"%@/#comments", comment];