我可以创建表。但无法将值传递给表。
- (IBAction)openMail:(id)sender {
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"Shopping Cart "];
NSArray *toRecipients = [NSArray arrayWithObjects:@"fisrtMail@example.com", @"secondMail@example.com", nil];
[mailer setToRecipients:toRecipients];
NSString *e=self.phone;
NSString *f=self.cost;
//NSString *emailBody = [NSString stringWithFormat:@"%@%@%@%@",e,@" ",f,@" has been purchased successfully"];
NSString *emailBody=@"<html> <table border=1> <thead><tr><td>Item</td><td>Name</td><td>Qty</td><td>Price</td></tr></thead><tbody><tr><td>1</td><td>1</td><td>One</td><td>One</td></tr><tr><td>2</td><td>Two</td><td>Two</td><td>Two</td></tr><tr><td>3</td><td>Three</td><td>Three</td><td>Three</td></tr><tr><td>4</td><td>Four</td><td>Four</td><td>Four</td></tr></tbody></table> </html> ";
[mailer setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:mailer animated:YES];
//[mailer release];
}
我需要将上面提到的值“e”和“f”传递给html中的表格。怎么做?你能回复一下吗。