Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate core data by deleting old one on App Update

Hi I'm going to update my iOS app in appstore and this update contains database change so now how to migrate my existing core data by deleting old database of existing version on App update? I have referred Core Data Migration tutorial

Core Data Migration Post

Unfortunately of no use. Any help is appreciated in advance

like image 759
Smith Avatar asked Sep 04 '13 16:09

Smith


1 Answers

Smith,
I presume you have done some schema changes, in the xcdatamodel
Always, Add a new Model Version (Select name.xcdatamodeld then Editor->Add model Version) before making any changes, if you have an app already submitted to App Store which is using the earlier model version.
Then,
Add a new file from Core Data Tab, as Mapping Model
Select, Source Model (Model Version which the submitted App is using)
Destination Model (Model Version in which you have done the Changes)

And you are done!

like image 121
Piyush Avatar answered Nov 14 '22 22:11

Piyush