开发者

how to pass html string into message body

I want to send pa开发者_StackOverflow社区rticular message to other people via email and sms option. the email portion work perfectly but i don't know how to pass a html string into message body.

for message, I am use MFMessageComposeViewController

and the string is like

NSString *emailBody = [NSString stringWithFormat:@"<p>Map of %@</p><table><tbody><tr valign='top'><td><b>Place Name:</b></td><td>%@</td></tr><tr valign='top'><td><b>Country Name:</b></td><td>%@</td></tr><tr valign='top'><td><b>Area Name:</b></td><td>%@</td></tr><tr valign='top'><td><b>Latitude:</b></td><td>%@</td></tr><tr valign='top'><td><b>Longitude:</b></td><td>%@</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table>http://maps.google.com/maps?q=%@,%@</a><BR></BR>", [dict objectForKey:@"name"],[dict objectForKey:@"name"], [dict objectForKey:@"country"], [dict objectForKey:@"area"], [dict objectForKey:@"lat"], [dict objectForKey:@"long"],[dict objectForKey:@"lat"], [dict objectForKey:@"long"], [dict objectForKey:@"lat"],[dict objectForKey:@"long"]];  

how to pass this string into setBody of message controller?


Are you sure you have assigned a delegate object to your MFMessageComposeViewController instance?. The delegate must conform to the MFMessageComposeViewControllerDelegate protocol.

To setup the initial content of the message use the body property.

Here is an example:

    MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
    picker.messageComposeDelegate = self;

    picker.recipients = [NSArray arrayWithObject:@"48151623"];  
    picker.body = @"We either live together... or die alone.";

    [self presentModalViewController:picker animated:YES];
    [picker release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜