我想用来CHCSVParser
将我的核心数据导出到 CSV。我知道如何从实体中获取所有值,但我不知道如何写入 CSV。
有人可以教我如何用 CSV 写入CHCSVParser
吗?
// Test listing all Infos from the store
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription
entityForName:@"NoteLog" inManagedObjectContext:context];
[fetchRequest setEntity:entity];
NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&error];
for (NoteLog *noteInfo in fetchedObjects) {
NSLog(@"Name: %@", noteInfo.city );
NSLog(@"Name: %@", noteInfo.country);
NSLog(@"Name: %@", noteInfo.datetime);
NSLog(@"Name: %@", noteInfo.notelatitude);
NSLog(@"Name: %@", noteInfo.notelongtitude);
NSLog(@"Name: %@", noteInfo.state);
NSLog(@"Name: %@", noteInfo.text);
}