06 Oct 2012, 16:39
Generic-user-small

Missaq Ataschi (2 posts)

hi i have just bought your eBook because of the iCloud and CoreData implementation what is at the moment the most confusing thing in iOS development… i just wanted to ask why you doesn’t use a mergepolicy in your example… if i edit two items at the same time iCloud will stop working for ever :))

After a little bit playing with the iCloud CoreData Code i must say i am a little bit disappointed… i have implement the “initializeCoreDataStackV2” method in my AppDelegate and always get the error: Error adding OLD persistent store to coordinator The operation couldn’t be completed. (Cocoa error 134080.) { NSUnderlyingException = “Can’t add the same store twice”; }

what can i do? I miss also some new things from iOS6 which apple shows on WWDC2012 video about iCloud and CoreData…

08 Oct 2012, 00:17
Avatarsmall_pragsmall

Marcus S. Zarra (254 posts)

Have you compared your code to the sample code?

The error you posted indicates that you are trying to add the same store twice. Did you typo a variable name?

10 Oct 2012, 12:53
Generic-user-small

Missaq Ataschi (2 posts)

hi marcus,

thx a lot for your answer… the error message was a mistake in my code sorry…

when i build it the first time everything works fine but the second time i get this error: exception ‘NSInvalidArgumentException’, reason: ‘nil is not a valid persistent store’ on this line: store = [coordinator migratePersistentStore:store toURL:storeURL options:options withType:NSSQLiteStoreType error:&error];

by the second build it seems that the store is nil… i can’t check your projekt because it doesn’t run…

i really think that iCloud with CoreData has still a lot of bugs and Apple has a lot todo… the WWDC 2012 example is more a workaround than a solution… thats really sad because there are a lot of developer which want use iCloud with CoreData and can’t…

22 Oct 2012, 01:17
Appleloop_pragsmall

Aaron Douglas (2 posts)

Hi Marcus -

I’m skipping around your beta book right now and I am primarily interested in the iCloud integration, specifically section 7.2 NSManagedObjectContext direct to iCloud. I noticed though that the example code zip file under the “iCloud” that its only the iCloud example using UIManagedDocument. Are you planning on also including the iCloud example code for putting the whole context into iCloud? Thanks much!

22 Oct 2012, 01:29
Appleloop_pragsmall

Aaron Douglas (2 posts)

Or maybe I’m just an idiot and didn’t see initializeCoreDataStack and initializeCoreDataStackV2. :)

06 Nov 2012, 19:27
Avatarsmall_pragsmall

Marcus S. Zarra (254 posts)

Aaron,

Yeah there are a couple of different variations of the code in the AppDelegate to demonstrate both paths.

Glad you solved it :)

22 Nov 2012, 22:37
Generic-user-small

Abhishek Patel (2 posts)

I’m having issues running the same app, with the same icloud sync data working properly. Running from scratch, using the initializeCoreDataStack method, with no pre-existing data on icloud (deleted from settings), launching the app on an iphone 5 boots and loads the context really fast.

On an iPad 2, it takes forever and it finally gives this error: NSLocalizedDescription = “The file upload timed out.”;

why is this happening? Is there a way to fix this issue?

Let me know. iCloud is turning to be really unpredictable, and frustrating.

P.S. is there a way to switch to local storage if icloud can’t be accessed and merge the changes once connection can be made?

26 Nov 2012, 10:05
Avatarsmall_pragsmall

Marcus S. Zarra (254 posts)

You can turn off the settings when you create the @NSPersistentStore@, that is about it.

iCLoud and Core Data is not ready for prime time in my opinion. It is better in 6.0 (which is part of the reason this book ignores 5.0) but it still has quite a ways to come before it is truly stable and mature.

30 Nov 2012, 17:35
Generic-user-small

Abhishek Patel (2 posts)

Thanks Marcus. Hope they improve upon it by the next OS

  You must be logged in to comment