Two separate but related questions regarding the use of Core Data:
I add an entity/attribute/relationship to my Core Data model in Xcode. Is there a way to have it recognize the information in the existing storedata
file and augment it, instead of simply saying that it is incompatible with the existing model?
For example, if I have a cars
entity and I decide to add a manufacturers
entity with 1:many a relationship between the two, how can I import the existing cars
entries?
Modifying the example in #1: If I have two existing Core Data models, one with cars
and one with manufacturers
, is there a way to create a new data model that has both entities, and can import as appropriate from the existing storedata
files for each?
Yes, Core Data has versioning and migration capabilities you can use to move a data model forward when changes are made. You can read the docs for this at this link: Introduction to Core Data Model Versioning and Data Migration Programming Guide