• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adventures in core-data, iCloud, and sandboxing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adventures in core-data, iCloud, and sandboxing


  • Subject: Adventures in core-data, iCloud, and sandboxing
  • From: Martin Hewitson <email@hidden>
  • Date: Thu, 03 Nov 2011 19:43:35 +0100

Here is my experience with trying to upgrade a core-data sandbox app to use sandboxing and iCloud.

1) A core-data shoebox app with no sandbox, no iCloud entitlements, XML store type

2) A core-data shoebox app with sandbox, iCloud integration, SQL store type

Starting from 1), how do I get to 2)?

Here are the individual steps which I have working in isolation

a) migration from XML store to SQL store
b) sandbox with migration of core-data store to the new container directory

But, I can't figure out a way to do both a) and b) in one move. If I switch on sandboxing and add my container-migration.plist, and try to migrate the store at the same time, then the app runs and appears to work fine, but I get a lot of console errors saying

+entityForName: could not locate an NSManagedObjectModel for entity name XXX

This doesn't happen if I do either a) or b).

Now for iCloud. If I avoid sandboxing, do the store migration to SQL and add the necessary iCloud keys to the persistent store coordinator options (NSPersistentStoreUbiquitousContentNameKey and NSPersistentStoreUbiquitousContentURLKey), then all looks well. If I don't do the store migration then I get errors like

[NSXMLObjectStore connection]: unrecognized selector sent to instance

So, can I conclude from this that iCloud and core-data only works with SQL store? The WWDC video hints at this, but was not explicit.

Now, I have no idea if the core-data store has actually been pushed up to the cloud. How can I see that? I will try next to run the app on another machine and see what happens.

So, a few steps in perhaps the right direction, but upgrading to all these new technologies is far from trivial. I guess I can go with store migration and iCloud for one release (assuming iCloud syncing is actually working), and then go with sandboxing in the next release. But what happens if a user skips a release? I guess badness will result. Hmm…

Comments welcome,

Martin



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
    Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Adventures in core-data, iCloud, and sandboxing
      • From: Roland King <email@hidden>
  • Prev by Date: Sandboxing disallows AppleEvents?
  • Next by Date: Re: Sandboxing disallows AppleEvents?
  • Previous by thread: Re: Sandboxing disallows AppleEvents?
  • Next by thread: Re: Adventures in core-data, iCloud, and sandboxing
  • Index(es):
    • Date
    • Thread