In my IOS app, I store two types of data in CoreData. One type is user generated, the other type is a pregenerated database. Currently this is all in the same store, which goes into the documents folder. But this is not a good approach, so I will split into 2 separate stores.
There are two problems:
- The pregenerated database should not be backed up by iCloud.
- When an update of the app is provided, the user data should be kept, but the pregenerated database should be overwritten. (The pregenerated database will have updated content, even if the data model is unchanged.)
For problem 1, I can either put the pregenerated database store in the cache directory, or keep it in the documents directory flagged for skipping backup. As the cache directory can be emptied any time, using the documents folder without backup seems better. However, does that solve problem 2? That is, will the pregenerated database be overwritten after an update?
If not, are there any other solutions?