R – Viewing CSV attachment in MFMailComposeViewController

csviphoneiphone-sdk-3.0mfmailcomposeviewcontroller

I have an application which generates a csv-file and then attaches it to an email using MFMailComposeViewController. This all works fine.

My problem is that I would like to add an option to view the contents of the csv before sending it. This functionality exists in Mail, where an attached csv can be displayed as a spreadsheet. My question is: can I access this functionality somehow to display the file, or do I have to resort to low level Core Graphics coding to generate the spreadsheet?

Best Answer

Have you tried loading the CSV file in a UIWebView? You can't interact programmatically with the MFMailComposeViewController UI, so you would have to try this before you display the mail compose interface. But since UIWebView can display all sorts of supported file formats, perhaps it understands CSV as well.