私は、ユーザーがサウンドを選択した場合に、アプリから自分にメールで送信できるアプリに取り組んでいます。
添付ファイルの部分は「機能しているように見えます」が、メールを送信すると、受信者に添付ファイルがありませんか?
iPad / iPhone自体では、作曲に関しては取り付けているように見えますが、機能していませんか?:/
これが私が使用しているコードです。
- (void)onSend:(id)sender{
int nIndex;
UIButton *btnSender = (UIButton *)sender;
NSLog( @"%d", btnSender.tag );
for ( int i = 0; i < [ m_aryFileName count ]; i++ ) {
if( i == ( btnSender.tag - 100 ) ){
nIndex = i;
}
}
NSString *strFileName = [ m_aryFileName objectAtIndex:nIndex ];
strFileName = [ strFileName stringByAppendingString:@".mp3" ];
NSData* nData = [ NSData dataWithContentsOfFile:strFileName ];
MFMailComposeViewController *pickerMail = [[MFMailComposeViewController alloc] init];
pickerMail.mailComposeDelegate = self;
[pickerMail setSubject:@"myMail Attachment"];
// Attach an image to the email
[pickerMail addAttachmentData:nData mimeType:@"audio/mp3" fileName:strFileName ];
// Fill out the email body text
NSString *emailBody = @"Here is your attachment";
[pickerMail setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:pickerMail animated:YES];
[pickerMail release];
}