iPhone | Core data migration for a new version built from scratch

后端 未结 3 1676
遥遥无期
遥遥无期 2021-01-16 09:26

I am working on an App update and this version is completely built from scratch and has completely new coreData model schema. I need to write coreData

3条回答
  •  迷失自我
    2021-01-16 10:15

    If you have the old App, then you can recreate the model from the compiled model file which is contained in the App bundle:

    • Sync the App to iTunes, if necessary.
    • Ctrl-Click on the App in iTunes, and use "Show in Finder" to locate the "YourApp.ipa" file.
    • Copy "YourApp.ipa" to a temporary directory, and use "unzip YourApp.ipa" on the command line to extract the archive.
    • In the extracted "Payload/YourApp.app" folder there should be a "XXX.momd" folder containing a file "XXX.mom" (XXX is the name of the model). This is the compiled model file.
    • In your Xcode project (or a temporary project), create a new "Data Model" file "XXX.xcdatamodeld".
    • Select this file and choose "Editor -> Import ..." from the menu.
    • In the import dialog, choose the "XXX.mom" file from above.

提交回复
热议问题