Triggering a Deep Copy

As mentioned at the beginning of this chapter, a deep copy will be demonstrated using the existing default data store. The default data store DefaultData.sqlite was previously configured as the initial store during setupCoreData via setDefaultDataStoreAsInitialStore. This method call has since been commented out, so on new installations an import from XML would be triggered instead. This is due to the call to checkIfDefaultDataNeedsImporting in the setupCoreData method that triggers an alert view giving the option to importFromXML. To trigger a deep copy from a persistent store instead, a new method called deepCopyFromPersistentStore is required in CoreDataHelper.m. Once an instance of CoreDataImporter has been created, ...

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.