我做了一个服装 UIActivity 类。我喜欢在课堂上发送带有附件的电子邮件,但我无法发送电子邮件,也无法展示课堂上的任何 ViewController。我正在尝试向 Mail ViewController 展示这个:
- (void)prepareWithActivityItems:(NSArray *)activityItems
{
NSString *subject = [NSString stringWithFormat:@"%@", [self.filePath lastPathComponent]];
NSString *messageBody = [NSString stringWithFormat:@"%@ was extracted with @FilyForiOS, visit", [self.filePath lastPathComponent]];
NSData *attachment = [NSData dataWithContentsOfFile:self.filePath];
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:subject];
[mc setMessageBody:messageBody isHTML:NO];
[mc setToRecipients:nil];
[mc addAttachmentData:attachment mimeType:[[self.filePath lastPathComponent] pathExtension] fileName:[self.filePath lastPathComponent]];
[self presentViewController:mc animated:YES completion:nil]; // Here is the error: No visible @interface for 'MailTo' declares the selector 'presentViewController:animated:completion:'
}
谁能告诉我如何从这个类中展示一个 ViewController ?