Do i need to create a mapping model for every model version of my app
Just a quick question.
If i have 4 versions of my Core Data Model
Version 1.00, 1.01, 1.02 and the newest 1.03
Do i have to create a mapping model for each version to the latest
Example do i have to create 1.00 -> 1.03 1.01 -> 1.03 (of course i have to create 1.0开发者_开发技巧2 -> 1.03
Or will it be fine if i have 1.00 -> 1.01 and 1.01 -> 1.02 and then now 1.02 -> 1.03
I can't seem to find anything by googling it, it's hard to know what search terms people would use
Exactly when you need to use a mapping model is based on how many changes you make from version to version. If the accumulated changes are minor enough that automatic migration can handle them, then you don't strictly speaking need a mapping model.
However, using a mapping model for every version is always the safest option. It ensures that no matter how your needs change you can always guarantee that you have will always have a smooth and reliable upgrade path.
精彩评论