2017-11-06 5 views
0

영구 저장 장치에 임의의 이름과 URL이 있음을 지정하기 위해 NSPersistentStoreUnbiquitousContentNameKey와 NSPersistentStoreUnbiquitousContentURLKey의 두 키를 사용하고 있습니다. 그러나이 키는 iOS 10.0에서 사용되지 않습니다. 대체 API를 사용하여이 사용되지 않는 API를 제거해야합니다.iOS 10.0 코어 데이터의 NSPersistentStoreUpiquitousContentNameKey 키와 교체하십시오.

-(NSPersistentStoreCoordinator *)persistentStoreCoordinator 
     { 
        //Return if the persistance store exists. 
        if(__persistentStoreCoordinator != nil) { 
         return __persistentStoreCoordinator; 
        } 

        __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]]; 
        NSPersistentStoreCoordinator *psc = __persistentStoreCoordinator; 



        NSMutableDictionary *options = [NSMutableDictionary dictionary]; 

        [options setObject:iCloudEnabledAppID   forKey:NSPersistentStoreUbiquitousContentNameKey]; 
        [options setObject:iCloudLogsPath    forKey:NSPersistentStoreUbiquitousContentURLKey]; 
        [options setObject:NSFileProtectionComplete forKey:NSPersistentStoreFileProtectionKey]; 

        [psc lock]; 


        return __persistentStoreCoordinator; 
    } 

iOS 10.0 릴리스 노트를 완료했지만 이에 대한 해결 방법을 찾지 못했습니다. 이 키들에 대체 항목이 있습니까?

미리 감사드립니다.

답변

0

이러한 키의 대안은 없습니다. 이 키는 Core Data의 iCloud 통합과 함께 사용되며 iOS 10에서는 더 이상 사용되지 않습니다.이 키와 함께 작동하는 모든 메소드, 변수 등은 현재 사용되지 않습니다. 직접적인 대체는 없습니다. iCloud 통합은 현재는 물론 지금까지도 계속 작동하지만 어느 시점에서는 종료 될 수 있습니다.

Apple은 CloudKit을 제공하지만 다르게 작동하므로 직접 교체하지 않습니다. CloudKit을 사용한다고해서 이러한 키를 대체 할 수는 없으며 앱을 다시 디자인해야합니다. Ensembles이라는 오픈 소스 프레임 워크가 있습니다.이 프레임 워크는 iCloud와 함께 Core Data와 같은 기능을합니다.

관련 문제