1

I have an application in the App Store and it has a Core Data model with some cached data. In new version of this app I need to migrate to new data model. I don't want to perform all this migration process, because cached data is not important at all. I want just to implement the next scenario in the new app version:

  • User has current version of app on his iPhone with some cached data in Core Data
  • User updates the app from the App Store
  • On first launch application removes all existing data with existing model and create new one
  • Application downloads new data from server and cache it in new model

How to implement such scenario?

So, I hope my question is clear enough. Thank you for you answers.

Alexander Perechnev
  • 2,797
  • 3
  • 21
  • 35
  • 1
    You may find this post helpful re: deleting the data. http://stackoverflow.com/questions/3266084/how-to-remove-all-objects-from-core-data Additionally, this tutorial goes over migrations--it's Swift, but Core Data in Swift vs. ObjC is very similar. http://www.raywenderlich.com/86136/lightweight-migrations-core-data-tutorial – Adrian Aug 18 '15 at 13:41
  • 1
    my idea is to delete the database file and recreate it again. I mean, if databaseexists at path, delete it and again create it. – Teja Nandamuri Aug 18 '15 at 13:41

0 Answers0