2010-07-11 6 views
0

Je dois définir une chaîne qui inclura une chaîne qui change (je peux déjà modifier cette chaîne) et du texte supplémentaire.variable iphone dans NSString

par exemple,

NSString *commentsAddress = *somestring*/#comments; 

maintenant je sais sould être quelque chose il plus le long des lignes de

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

mais je ne peux pas obtenir ce travail.

Répondre

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

travaillé sans faille. Merci. –