2012-11-16 1 views
0

내 애플 리케이션을 위해 Apple SharedCoreData 샘플을 수정 해 보았습니다.iOS/MacOS - iCloud 경고 - SharedCoreData를 기반으로하는 편재 오류

[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1055): CoreData: Ubiquity: 
Error: A persistent store which has been previously added to a coordinator using the iCloud integration options must always be 
added to the coordinator with the options present in the options dictionary. 


If you wish to use the store without iCloud, migrate the data from the iCloud store file to a new store file in local storage. 
file://localhost/Users/david/Library/Containers/.../Data/Documents/SharedCoreDataStores/localStore.sqlite 

This will be a fatal error in a future release. 

사람이 건너가 있고 어떻게 그것을 해결 않습니다

모든 (합리적으로) 확인이 경고를 제외입니까?

+0

이 사람이왔다 그것을 통해,하지만 아직 답변 : http://stackoverflow.com/questions/13343449/how-can-i-migrate-the-data-from-the-icloud-store-file-to-a-new-store -file-in-loc –

+0

오 ~ 이런. 나는 그걸 보지 못했다. 로컬 저장소를 사용하지 않고 문제를 건너 뛸 수 있지만 좋은 해결책은 아닙니다. iCloud가 참여할 새로운 상점을 만드는 방법을 알아야합니다. –

답변

2

이 오류가 표시되면 상점 파일에 iCloud 메타 데이터가 포함되어 있다고 추가하면 은 파일이 iCloud에 추가되었음을 의미합니다.

아이 클라우드 저장소를 추가 할 때이 옵션을 추가해야합니다

 NSDictionary *options = 
     @{ NSMigratePersistentStoresAutomaticallyOption:@(YES), 
     NSInferMappingModelAutomaticallyOption  :@(YES), 
     NSPersistentStoreUbiquitousContentNameKey :self.iCloudCoreDataContentName, 
     NSPersistentStoreUbiquitousContentURLKey :self.iCloudCoreDataContentURL}; 

self.iCloudCoreDataContentName (필요) 당신이 원하는 이름, 아이 클라우드 저장소, 이름

self.iCloudCoreDataContentURL (선택 사항) 핵심 데이터를 찾을입니다 [[NSFileManager URLForUbiquityContainer:nil] URLByAddingComponent:@"CoreDataLogs"].

,536처럼,이 URL은 iCloud에 컨테이너의 서브 디렉토리이어야한다

iCloud에 컨테이너에 로그를 전송

이 속성은 옵션에서 선택 사항입니다. 이를 생략하면 iCloud CoreData 콘텐츠 URL은 [NSFileManager URLForUbiquityContainer:nil]이됩니다.

는 당신이주의해야하는 URL과 이름에 대한

자세한 내용 : 로컬 저장소에 아이 클라우드 저장소를 설정하려는 경우에 내 대답 볼 수 있습니다 Xcode - "The provided ubiquity name is already in use" - how do I find a folder

: How can I migrate the data from the iCloud store file to a new store file in local storage?

+1

고맙습니다. 코드가 클라우드에서 로컬로 옮겨 지도록합니다. 잘 했어. 당신이 돕는 동안이 질문을 보시겠습니까? http : //stackoverflow.com/questions/13906812/xcode-the-provided-ubiquity-name-is-already-in-use-how-do-i- find-a-folder –

+0

나는 몇몇 세부 사항을 썼다. 당신의 문제를 해결할 수 있을까요? – frogcjn