How to convert the NSMutableArray to CSV file on iPhone?

前端 未结 3 1268
时光说笑
时光说笑 2020-12-28 10:33

I am writing an iPhone application, which contains a function. It can convert the NSMutableArray to a CSV file. However, I don\'t know how to do. Can anyone help me to do th

3条回答
  •  清歌不尽
    2020-12-28 11:21

    NSString *csv = [myArray componentsJoinedByString: @","];
    

    But be warned, this will not account for commas within the array's elements. You will need to define some escaping/unescaping technique for that, and that's entirely up to you to do.

提交回复
热议问题