NSString中的iphone变量

NSString中的iphone变量,iphone,objective-c,xcode,nsstring,Iphone,Objective C,Xcode,Nsstring,我需要定义一个字符串,其中包含一个更改的字符串,我可以更改该字符串和其他文本 比如说, NSString *commentsAddress = *somestring*/#comments; 现在我知道它应该是更符合 NSString *commentsAddress = @"%@/#comments", *somestring*; 但我不能让它工作 NSString *comment = @"This is the comment"; NSString *commentAddress =

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

比如说,

NSString *commentsAddress = *somestring*/#comments;
现在我知道它应该是更符合

NSString *commentsAddress = @"%@/#comments", *somestring*;
但我不能让它工作

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