2014-10-12 9 views
9

से बाहर है मेरा आईक्लाउड कोर डेटा ऐप आईओएस 7 पर अच्छा चल रहा था और लॉन्च करने के लिए तैयार था। जब मैं आईओएस 8 पर परीक्षण करता हूं तो मुझे निम्न त्रुटि मिलती है और iCloud पर डेटा अपलोड करने का प्रयास करते समय इसे ठीक नहीं किया जा सकता है।iCloud कोर डेटा IOS8 पथ किसी भी क्लाउड डॉक्स कंटेनर

मुझे लगता है मेरी समस्या है कि कैसे मैं दस्तावेज़ निर्देशिका और iOS8 साथ डॉक निर्देशिका में परिवर्तन हो रही है से संबंधित है, लेकिन मैं सिर्फ इस को समझ नहीं सकता ..

014-10-12 15:14:17.862 XXXXXXX [4662:236693] __45-[PFUbiquityFilePresenter processPendingURLs]_block_invoke(439): CoreData: Ubiquity: Librarian returned a serious error for starting downloads Error Domain=BRCloudDocsErrorDomain Code=6 "The operation couldn’t be completed. (BRCloudDocsErrorDomain error 6 - Path is outside of any CloudDocs container, will never sync)" UserInfo=0x7f8b1a525f60 {NSDescription=Path is outside of any CloudDocs container, will never sync, NSFilePath=/Users/garyrea/Library/Developer/CoreSimulator/Devices/9AADFE8E-5ECC-4969-9418-57DA45B747C9/data/Containers/Data/Application/AD2E5E62-7295-4371-A08D-1790E8FCCD96/Documents/CoreDataUbiquitySupport/nobody~simA28745A4-A67F-598C-9260-F9AC36609ECF/iCloud/5B8BFA36-1ACA-4966-B7ED-A7344D36ACF1/container/nobody~simA28745A4-A67F-598C-9260-F9AC36609ECF/iCloud/2trlqdMQVpJ~wlEfiLvjWtQfrUJ8YiNCd84KW_xiw4A=/F0CF5F29-D437-4728-B0A2-C5BB90BBC239.1.cdt} with userInfo { 
    NSDescription = "Path is outside of any CloudDocs container, will never sync"; 
    NSFilePath = "/Users/garyrea/Library/Developer/CoreSimulator/Devices/9AADFE8E-5ECC-4969-9418-57DA45B747C9/data/Containers/Data/Application/AD2E5E62-7295-4371-A08D-1790E8FCCD96/Documents/CoreDataUbiquitySupport/nobody~simA28745A4-A67F-598C-9260-F9AC36609ECF/iCloud/5B8BFA36-1ACA-4966-B7ED-A7344D36ACF1/container/nobody~simA28745A4-A67F-598C-9260-F9AC36609ECF/iCloud/2trlqdMQVpJ~wlEfiLvjWtQfrUJ8YiNCd84KW_xiw4A=/F0CF5F29-D437-4728-B0A2-C5BB90BBC239.1.cdt"; 
} for these urls: (
    "file:///Users/garyrea/Library/Developer/CoreSimulator/Devices/9AADFE8E-5ECC-4969-9418-57DA45B747C9/data/Containers/Data/Application/AD2E5E62-7295-4371-A08D-1790E8FCCD96/Documents/CoreDataUbiquitySupport/nobody~simA28745A4-A67F-598C-9260-F9AC36609ECF/iCloud/5B8BFA36-1ACA-4966-B7ED-A7344D36ACF1/container/nobody~simA28745A4-A67F-598C-9260-F9AC36609ECF/iCloud/2trlqdMQVpJ~wlEfiLvjWtQfrUJ8YiNCd84KW_xiw4A=/F0CF5F29-D437-4728-B0A2-C5BB90BBC239.1.cdt" 
) 

मेरे ऐप प्रतिनिधि एक्सटेंशन कोड जहां मैं अपना निरंतर स्टोर बना रहा हूं। मेरे पास पहली बार स्थापना के लिए एक बीज डेटाबेस है।

- (NSPersistentStoreCoordinator *)createPersistentStoreCoordinator{ 
    NSPersistentStoreCoordinator *persistentStoreCoordinator = nil; 
    NSManagedObjectModel *managedObjectModel = [self createManagedObjectModel]; 
    persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc]initWithManagedObjectModel:managedObjectModel]; 
    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@ 
    "CoreData.sqlite"];  

    if (![[NSFileManager defaultManager]fileExistsAtPath:[storeURL path]]){ 
     NSURL *preloadURL=[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"SeedDatabase" ofType:@ 
     "sqlite"]]; 
     NSError *error=nil; 
     if (![[NSFileManager defaultManager] copyItemAtURL:preloadURL toURL:storeURL error:&error]){ 
      NSLog(@ 
      "File couldnt save"); 
     } 
    } 


    NSUbiquitousKeyValueStore *kvStore=[NSUbiquitousKeyValueStore defaultStore]; 
    if (![kvStore boolForKey:@"SEEDED_DATA"]){ 
     NSLog (@ 
     "In the new database"); 
     NSURL *seedStoreURL=[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"SeedDatabase" ofType:@ 
     "sqlite"]]; 
     NSError *seedStoreErrpr; 
     NSDictionary *[email protected]{NSReadOnlyPersistentStoreOption: @YES}; 
     NSPersistentStore *seedStore=[persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:seedStoreURL options:seedStoreOptions error:&seedStoreErrpr]; 

     NSDictionary *iCloudOptions [email protected]{NSPersistentStoreUbiquitousContentNameKey: @"iCloud", 
             NSMigratePersistentStoresAutomaticallyOption:@YES, 
             NSInferMappingModelAutomaticallyOption:@YES 
     }; 

     NSOperationQueue *queue=[[NSOperationQueue alloc] init]; 
     [queue addOperationWithBlock:^{ 
      NSError *error; 
      [persistentStoreCoordinator migratePersistentStore:seedStore toURL:storeURL options:iCloudOptions withType:NSSQLiteStoreType error:&error]; 
      NSLog(@ 
      "Persistant store migrated"); 
      [kvStore setBool:YES forKey:@ 
      "SEEDED_DATA"]; 
      // [self checkForDuplicates]; 
     }]; 
    }else{ 
     NSError *error; 
     NSDictionary *storeOptions [email protected]{NSPersistentStoreUbiquitousContentNameKey: @ 
      "iCloud" 
     }; 
     if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType 
             configuration:nil 
             URL:storeURL 
             options:storeOptions 
             error:&error]) { 
      NSLog(@ 
      "Unresolved error %@, %@", error, [error userInfo]); 
      abort(); 
     } 
    } 

    return persistentStoreCoordinator; 
} 

- (NSURL *)applicationDocumentsDirectory{ 
    return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; 
} 
+1

एक समाधान के साथ समाप्त हो गया? एक ही त्रुटि यहाँ .. – MatterGoal

+1

मैं icloudOptions शब्दकोश में iCloud निर्देशिका निर्दिष्ट करके इसे हल करने में सक्षम था। मुझे इसे सभी उपकरणों से पूरी तरह से हटाने की आवश्यकता है, iCloud ड्राइव फ़ाइलों को हटाएं और किसी डिवाइस पर पुनरारंभ करें। पोस्ट – grayentropy

+0

मुझे एक ही त्रुटि मिल रही है और सोच रहा है कि यदि उपयोगकर्ता क्लाउड निर्देशिका के लिए पूछता है तो उपयोगकर्ता ने iCloud बंद कर दिया है और 'NSFileManager' रिटर्न 'nil' है? –

उत्तर

5

मैं iCloud ड्राइव निर्देशिका (developer.apple.com इंटरफ़ेस पर एक जैसा नाम) निर्दिष्ट करके इस त्रुटि को हल करने में सक्षम था।

-(NSURL *)cloudDirectory 
{ 
NSFileManager *fileManager=[NSFileManager defaultManager]; 
NSString *[email protected]"iCloud"; 
NSString *bundleID=[[NSBundle mainBundle]bundleIdentifier]; 
NSString *cloudRoot=[NSString stringWithFormat:@"%@.%@",teamID,bundleID]; 
NSURL *cloudRootURL=[fileManager URLForUbiquityContainerIdentifier:cloudRoot]; 
NSLog (@"cloudRootURL=%@",cloudRootURL); 
return cloudRootURL; 
} 

और के रूप में एक NSPersistentStoreUbiquitousContentURLKey

NSDictionary *storeOptions [email protected]{NSPersistentStoreUbiquitousContentNameKey: @"iCloud", 
            NSPersistentStoreUbiquitousContentURLKey:[self cloudDirectory], 
            }; 

मैं कुछ अजीब त्रुटियों हो रही थी तो मैं सभी उपकरणों से ऐप्स को निकाल दिया, iCloud ड्राइव फ़ाइल हटा दी और फिर से icloudOptions शब्दकोश में शामिल एक वास्तविक पर भाग गया डिवाइस और यह ठीक काम किया। यह सुनिश्चित नहीं है कि यह अब आईओएस 7 पर चलता है लेकिन चूंकि मैंने केवल एनएसपीर्सिस्टेंटस्टोर यूबिकिटसकंटेंटURL को निर्दिष्ट किया है, मुझे पूरा विश्वास है कि यह ठीक होना चाहिए।

+1

मैंने कोशिश की लेकिन मुझे मिलता है: "यूआरएल के पार्स घटकों को जारी रखने में असमर्थ:/var/मोबाइल/लाइब्रेरी/मोबाइल दस्तावेज़/iCloud ~ com ~ उदाहरण ~ foo/CoreData/MyAppCloudStore /। बेसलाइन/MyAppCloudStore " – Ixx

+0

आपने टीमआईडी में क्या सेट किया? – user3065901

-1

मुझे कुछ परीक्षण डेटा लोड करने के दौरान एक ही समस्या थी। डेटा के लोड के लिए मैं सभी रिकॉर्ड हटा रहा था। अपवाद से बचने के लिए सफाई और लोडिंग के बीच एक साधारण नींद (1) पर्याप्त थी।

संबंधित मुद्दे