Attach csv to email xcode

后端 未结 2 1309
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-16 23:03

I got a working csv attachment to an email view. The problem is, that when I open the csv on the iPhone it displays the file really nice into separate columns. But if I open

2条回答
  •  青春惊慌失措
    2021-01-16 23:58

    The solution to my own problem was quite simple (if anyone ever happens to come across my post): I replaced the "," by a semicolon so

    [csv appendFormat:@"\n%@ ;%@,", key, value];
    

    (don't need the \" since it*'s a string already). It works with excel now but does not display correctly on iPhones/iPads anymore because the field separator there is a ",".

    But my problem is solved.

提交回复
热议问题