How to convert the NSMutableArray to CSV file on iPhone?

前端 未结 3 1253
时光说笑
时光说笑 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条回答
  •  梦毁少年i
    2020-12-28 11:36

    Better approach is use xlsx instead of csv... It is easy:

    You can use XlsxReaderWriter library...It is free and usefull for read & write!

    • Create a new project or open an existing project
    • Insert XlsxReaderWriter.xcodeproj as a sub project of your project
    • In your target Build phases insert XlsxReaderWriter as a target dependency
    • Add libXlsxReaderWriter.a and libz.tbd in Link binary with Libraries. Older systems can use libz.dylib instead of libz.tbd.
    • Add -all_load in Linking / Other Linker Flags in your project settings
    • Add the XlsxReaderWriter root directory path to User Header Search Paths and set it as recursive. For example, set the path to "$(SRCROOT)/XlsxReaderWriter/", not "$(SRCROOT)/XlsxReaderWriter/XlsxReaderWriter/".

    Now, you can import BRAOfficeDocumentPackage.h in your code.

    It also supports Swift:

提交回复
热议问题