开发者

iphone variable in NSString

I need to define a string that will include a string that changes (i can already make that string change) and additional text.

开发者_如何学运维

for example,

NSString *commentsAddress = *somestring*/#comments;

now i know it sould be something more along the lines of

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

but I can't get this to work.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜