アプリに組み込まれているフォトアルバムから写真を選択するiPhoneアプリケーションがあります。この写真をメールで共有するオプションを備えた共有ボタンを追加したいのですが、このコードを使用して既存の写真を添付できます。
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@""];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@""];
[picker setToRecipients:toRecipients];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"project existing photo" ofType:@"jpg"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/jpeg" fileName:@"photo name"];
// Fill out the email body text
NSString *emailBody = @"";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
しかし、選択したフォトアルバムを電子メールの本文に添付するには、このコードで何を変更する必要がありますか?前もって感謝します。