0

我想做以下事情

[controller setMessageBody:[NSString stringWithFormat:@"<strong>%@</strong> <br> <br> %@ <br><br> %@ <br><br> Sent From MyApp",self.articleTitle, self.articleDescription, self.articleURL] 
isHTML:YES];

在最后 %@ 我想做<a href="%@">Hello</a>

但我不确定如何正确逃避它?

4

1 回答 1

2

只需使用

@"....<a href=\"%%@\">Hello</a>..."

如果你把它放在格式中,或者使用

@"<a href=\"%@\">Hello</a>"

如果您%@在格式字符串中使用它。%@仅在stringWithFormat:此处方法的第一个参数中解释。

于 2010-07-28T23:19:38.090 回答