Seeding

When users enable iCloud support in an application they already use, chances are they have data that needs to be migrated to iCloud. The technique that will be used to migrate non-iCloud data to iCloud in Grocery Dude is deep copy, which was implemented in Chapter 9, “Deep Copy.” Although more CPU intensive than migratePersistentStore, this approach provides the granularity of per-entity migration and allows object values to be updated as they are migrated. With the ability to update attribute values as they are migrated, the modified attribute can be set to today’s date. This ensures that the de-duplication process is more effective when default data with the same date on multiple devices is migrated. Listing 15.7 shows new CoreDataImporter ...

Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.