My application has a function which can export some data to a csv file, and then copied to PC. What api to use to implement this function?
You can also do something like:
[[array componentsJoinedByString:@","] writeToFile:@"components.csv" atomically:YES encoding:NSUTF8StringEncoding error:NULL];
You can use combinations of this to put together a CSV (append the output of one array for the column names to one array for the values, etc).
Of course, you have to be careful to put quotes around values that already contain a comma, and to then escape any quotes in the value.