【发布时间】:2012-07-03 05:07:37
【问题描述】:
我想在 Objective-c 中添加一个热 html 链接到一封电子邮件。我知道,如果我有一个特定的 url,它通常的工作方式是:
[composer setMessageBody:[NSString stringWithFormat:@"Example text,
<a href=\"google.com\">Link Name</a> More example text"];
但我希望有一个带有自定义生成 url 的热链接作为链接的标题和链接的网站,所以更像:
[composer setMessageBody:[NSString stringWithFormat:@"Example text,
<a href=%@>%@</a>", self.link, self.link];
但这让我崩溃了。想法?
【问题讨论】:
-
除了缺少的
],href 的值应该用href=\"%@\"之类的引号括起来。您也可以使用href='%@'。
标签: html objective-c email hyperlink