I am afraid for several weeks to solve this problem. so please help me solve this problem.
I downloaded the sample master data code with iCloud from apple WWDC 2012. and tried to use it for my application, but nothing worked.
Of course, I changed the code a bit ... but I don’t know exactly what I should do, and I can’t find any website that talks about this and the tutorials.
I spent several weeks and I'm tired. I know this is due to my lack of skills.
The problem I am facing is ...
- (void)asyncLoadPersistentStores { NSError *error = nil; if ([self loadLocalPersistentStore:&error]) { NSLog(@"Added local store"); } else { NSLog(@"Unable to add local persistent store: %@", error); } //if iCloud is available, add the persistent store //if iCloud is not available, or the add call fails, fallback to local storage BOOL useFallbackStore = NO; if ([self iCloudAvailable]) { if ([self loadiCloudStore:&error]) { NSLog(@"Added iCloud Store"); //check to see if we need to seed data from the seed store if (SEED_ICLOUD_STORE) { //deleted because SEED_ICLOUD_STORE value is false } //check to see if we need to seed or migrate data from the fallback store NSFileManager *fm = [[NSFileManager alloc] init]; if ([fm fileExistsAtPath:[[self fallbackStoreURL] path]]) { //migrate data from the fallback store to the iCloud store //there is no reason to do this synchronously since no other peer should have this data dispatch_queue_t globalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_async(globalQueue, ^{ NSError *blockError = nil; BOOL seedSuccess = [self seedStore:_iCloudStore withPersistentStoreAtURL:[self fallbackStoreURL] error:&blockError]; if (seedSuccess) { NSLog(@"Successfully seeded iCloud Store from Fallback Store"); } else { NSLog(@"Error seeding iCloud Store from fallback store: %@", error); abort(); } }); } } else { NSLog(@"Unable to add iCloud store: %@", error); useFallbackStore = YES; } } else { useFallbackStore = YES; } if (useFallbackStore) { if ([self loadFallbackStore:&error]) { NSLog(@"Added fallback store: %@", self.fallbackStore); //you can seed the fallback store if you want to examine seeding performance without iCloud enabled //check to see if we need to seed data from the seed store if (SEED_ICLOUD_STORE) { //deleted } } else { NSLog(@"Unable to add fallback store: %@", error); abort(); } } }
this is part of my source code from CoreDataController.m (session WWDC 2012 227) then the program stops when it calls the loadLocalPersistentStore method and I received this error message "Local storage not found in the package, this is most likely a build problem , make sure the repository file is copied as a package resource. "
I assume that the reason I got this is because I don't have a localStore.sqlite file and fallbackStore.sqlite, such as a sample. therefore he makes a mistake.
but although I skip this part (comment on it), I can’t connect iCloud, because now I got this error message "Unable to add iCloud storage: Error Domain = NSCocoaErrorDomain Code = 134100" The operation could not be completed. (Cocoa error 134100.) "UserInfo = 0x1dd93040 {metadata = {NSPsistenceFrameworkVersion = 419;"
I learned a lot about basic data from iCloud on iOS5, and it worked almost perfectly. but now I'm like a stupid person. I can not do anything. please help me.
strange thing: there is no code that entered the iCloud application identifier, the URL in the sample code from apple.
Thanks.