我正在使用openURL打开邮件客户端时遇到问题。这是代码。使用openURL发送邮件的问题
NSString *subject = @"Demo Subject";
NSString *body = @"<html><head>Header</head><body><a href=\"http://example.com\">Here is the demo link</a></body></html>";
NSString *urlString = [NSString stringWithFormat:@"mailto:?&subject=%@&body=%@",subject,body];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
我想,没有任何一种使用特殊字符需要进行编码,这是目前做的,而不是在示例文本显示在这里。
感谢
Chetu,thanx,它的工作......在这里,我只是尝试了openURL的整个urlString的NSUTF8StringEncoding。如果使用CFURLCreateStringByAddingPercentEscapes,它会起什么作用吗? – illuminatus 2011-05-30 06:46:20