简体   繁体   中英

Exporting Data to Mail in CSV format

I have a list of Expenses Which include date,categoryName and Amount stored in Coredata. I want them to be transferred in CSV Format to Mail.Can this be done?.I also want only the data in the current month to be sent.

I googled it and all i found is CHCSV parser and i have no idea on how to use it.

Converting your data to csv should be easy, just declare a mutable string, iterate over the objects you want to add and add the values you need to the string with comma seperation (best to enclose the data values in "", too). You can google on the csv format in wiki. Then you write that string to a temp .csv file. Then, using mfmailcomposer, you attach the .csv-file to the mail and you're done.

If you don't come up with a solution by googling these pieces of information, ask a more specific follow-up question here. But there are many resources on mfmailcomposer with examples out there.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM