我正在使用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