Warve
Warve

Reputation: 511

iOS update coreData when app updates

I'm currently designing the architecture for an iOS app and have a question relating to the use of coreData to store values.

The theory I'm looking to store values pertaining to specific items inside coreData along with specific user information that they set when using certain functionality.

Updating When I release an update the app will update old values with new ones inside each entity. I'll use some version check before the code initialises to stop this happening on every load.

Question When the app updates will it delete all values stored by the user or just the entities referenced in the update code?

Upvotes: 2

Views: 1785

Answers (2)

Mnsd
Mnsd

Reputation: 35

  1. Select xcdatamodeld first, then you can see "Add Model Version" in "Editor". then add "version name" -> finish. you can see new version added in folder. enter image description here

Upvotes: 0

Lumialxk
Lumialxk

Reputation: 6369

Firstly, Core Data has version management. Just add new version:

enter image description here

Secondly, after version updated, Core Data will not delete stored values unless you deleted that attribute.

Upvotes: 2

Related Questions