我将我的对象保存在 NSData 格式的 NSMutablearray 中。不,我尝试附加到电子邮件正文中。这里是代码。
- (IBAction)sendEmail
{
if ([MFMailComposeViewController canSendMail])
{
NSArray *recipients = [NSArray arrayWithObject:@"example@yahoo.com"];
MFMailComposeViewController *controller = [[MFMailComposeViewController
alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"Iphone Game"];
NSString *string = [viewArray componentsJoinedByString:@"\n"];
NSString *emailBody = string;
NSLog(@"test=%@",emailBody);
[controller setMessageBody:emailBody isHTML:YES];
[controller setToRecipients:recipients];
[self presentModalViewController:controller animated:YES];
[controller release];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
message:@"Your device is not set up for email." delegate:self
cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
}
}
我没有收到任何错误,但在 E-mail.in NSLog 中没有看到任何数据我看到了这个..2012-05-07 15:33:22.984 Note List[273:207] test=>]请建议任何一种更好的解决方案我如何在电子邮件正文中附加我的 NSMutableArray 数据..