Посмотрите следующий код
NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"plist"];
NSArray *commentArray = [NSArray arrayWithContentsOfFile:plistPath];
NSMutableString *mainString=[[NSMutableString alloc]initWithString:@""];
for(int i=0;i<[commentArray count];i++ ) {
NSString *string=[[commentArray objectAtIndex:i]objectForKey:@"cmtName"];
string=[string stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""];
[mainString appendFormat:@"\"%@\"",string];
string=[[commentArray objectAtIndex:i]objectForKey:@"cmtDesc"];
string=[string stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""];
[mainString appendFormat:@",\"%@\"",string];
string=[[commentArray objectAtIndex:i]objectForKey:@"cmtType"];
string=[string stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""];
[mainString appendFormat:@",\"%@\"",string];
[mainString appendFormat:@",\"%@\"",string];
[mainString appendFormat:@"\n"];
}
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectoryPath stringByAppendingPathComponent:@"Docment.conf"];
NSData* settingsData;
settingsData = [mainString dataUsingEncoding: NSASCIIStringEncoding];
if ([settingsData writeToFile:filePath atomically:YES])
NSLog(@"writeok");
Вы также можете использовать https://github.com/davedelong/CHCSVParser для генерации CSV.