views:

140

answers:

2

Hello everyone,

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?

+1  A: 

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.

Ole Begemann
It works! It immediately solved my next problem as well, how to view .doc-files. Thanks!
MW
A: 

I believe you will have to create a CSV file viewer yourself. I don't know of any of the existing controllers or views that will turn a CSV file into a spreadsheet view for you.

-t

Tim