1

This new updated version of the app has a significant change in how one of the attributes gets stored so i need all previous entities to be erased to avoid errors in the app. I have found how to delete all stored entities but i am only wanting it to happen once on, or before, the first launch of the updated version so it can start fresh (is this even allowed by apple?). I need to know what the best approach to this would be and any help or push in the right direction would be greatly appreciated.

jscs
  • 63,694
  • 13
  • 151
  • 195
MarissaMay
  • 11
  • 1
  • You can save a boolean variable 'oldDataErased', and set it to true after deleting everything. Then you save that variable to UserDefaults so every time the app starts it already know that old stored entities has been deleted – J Manuel Aug 11 '17 at 23:38
  • If only one attribute has changed can't you use migration code to update this attribute? It would be much less disruptive to your users. Alternatively, just use a new store and delete the old file if it exists – Paulw11 Aug 11 '17 at 23:55

0 Answers0