CHCSVParser
을 사용하여 코어 데이터를 CSV로 내보내겠습니다. 엔티티에서 모든 가치를 얻는 방법을 알고 있지만 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);
}
Rayan 안녕하세요, 당신이 나에게 예를 제공하는 beable 것인가? 내가 필요한 모든 데이터를 내보내려면 그게 전부 – Desmond
특정 사건에 대한 몇 가지 코드를 추가했습니다. 그걸 붙여 넣으면 콘솔에서 멋진 CSV 출력을 얻어야합니다. 거기에서 나는 그것을 당신이 그것을 파일에 넣는 방법을 알고 그것을 가지고 무엇을 하든지 할 수 있다고 믿습니다. –
굉장한 감사 Rayan. 완벽하게 작동합니다. – Desmond