0
버전 업데이트가 필요하지만 새 버전에서는 코어 데이터에 두 개의 새로운 속성을 추가하기 때문에 이전 버전의 데이터를 새 버전으로 마이그레이션하려고합니다. 내 단계 :핵심 데이터 모델 버전 관리 및 데이터 마이그레이션
- 선택 .xcdatamodeld 파일은 다음 편집기 -> 모델 버전
- 디자인> 데이터 모델> 설정 현재 버전을 추가합니다.
수정 옵션
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil]; if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error])
하지만 내 새로운 버전은 더 이전 버전에서 데이터를 찾을 수 없습니다. 수정 방법