Can an iPhone App create and send + receive and read a CSV file as an ATTACHMENT?
I'd like to introduce a feature in my iPhone App that allows the following: 1) creat开发者_运维技巧ing and sending by email a CSV file from within my iPhone App. 2) importing into my iPhone App a CSV file created with 3rd party software and sent to me by email.
These are the questions: 1a) Is it possible to actually create a CSV file from within the App and send it as an attachment? I know I can send an email containing all the strings required, but I want to be able to send the actual file. 1b) Once created, can this file be stored into the memory allocated to my iPhone App? 2) What procedure should I follow to import a CSV file into my App? I do not want to read the CSV file from a URL. Can all this be done with the iPhone or not??
Thanks!
1a) Yes, you can use the addAttachmentData:mimeType:fileName:
method on an instance of the MFMailComposeViewController
class to do that.
1b) Yes, you can write the NSString
containing the CSV data to a file using the writeToFile:atomically:encoding:error:
method.
2) Yes, in iOS 4 you can subscribe your app to certain file types, go here for more detailed information.
精彩评论