Frage

I want migrate the core data two models. According to apple documents there are two ways to migrate the model like light weight migration and mapping model. My confusion is In which scenario i need to use mapping model way of core data migration.

War es hilfreich?

Lösung

Lightweight migration is performed when you add/modify/delete attribute or entity - generally simple operations.

Mapping option is needed when you have to transform one schema into another. Let's say you and entity A, but you need to divide it into two: B and C. Then you have to tell CoreData how to map entities and attributes between the schemes.

This process is a little bit more complicated than lightweight migration. It requires to create mapping model file, define NSEntityMigrationPolicy subclass if needed, and so on, depending on your needs.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top