我想以编程方式在 iOS 中的单个邮件中发送多个附件文件。到目前为止,我已经尝试了以下方法:
// I give the file from array
NSString *str_mail = [readingEmfReading objectAtIndex:0];
// here I can encode the file
NSData *myData = [str_mail dataUsingEncoding:NSUTF8StringEncoding]
//here I can attach the file with extance of .csv
[controller addAttachmentData:myData mimeType:@".cvs" fileName:retriveEmail]
//here I can set the body for mail
[controller setMessageBody:@"file" isHTML:NO];
//here code for sent mail
if (controller) [self presentViewController:controller animated:YES completion:nil];
通过使用此代码,我只能发送一个附件。但是,我想发送多个文件。我怎样才能做到这一点?