문제

i hav a file with some data and i want to attach this file to mail, and i am using the default mail composer ...

any idea how to attach the file to mail before sending to receipents....

Thanks in advance....

도움이 되었습니까?

해결책

Example with an attached image:

NSData *myData = UIImagePNGRepresentation(myImage);
[mailComposer addAttachmentData:myData mimeType:@"image/png" fileName:@"MyImage"];

다른 팁

NSString *path = [[NSBundle mainBundle] pathForResource:@"bg" ofType:@"jpg"];

NSData *myData = [NSData dataWithContentsOfFile:path];

[controller addAttachmentData:myData mimeType:@"image/jpg" fileName:@"Attachment-1"];
[self presentModalViewController:controller animated:YES];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top