0

I am interpreting a function onto my iOS App to attach an original data on the Email as a file. The app is a movie composer.

The data format is written as XML and I want the app to attach the data on the Email as the file with an original extension (.kpt). Besides, I want the receiver to open the received XML file using the movie composer.

The question is the following:

  1. How to let the app to attach the original data to the email with an original extension?
  2. How to let the email receiver to open the received file using my app?
Chappy 003
  • 444
  • 1
  • 5
  • 15
  • 2 SO questions that may help: http://stackoverflow.com/questions/4302403/how-can-send-a-file-as-attachment-in-objective-c and http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application – Andrew Tetlaw Jan 08 '13 at 01:58

1 Answers1

1

How to setup an attachment:

MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
[mailController setSubject:@"Some Subject"];
[mailController addAttachmentData:data
                         mimeType:@"application/kpt"
                         fileName:@"originalFileName.kpt"];

In order to open the file inside your app, you will need to modify your Info.plist to describe a new document UTI. The programming guide for doing this can be found here.

Wayne Hartman
  • 18,369
  • 7
  • 84
  • 116