3.2. Add a template version (Core Data Application Practice Guide)

Source: Internet
Author: User

To not crash like 3.1, create a new model version before modifying the model. Once added, a new Xcdatamodel file is generated and is exactly the same as the original content, which is interesting, but do not delete the old version of the original model. The old model helps to migrate the original persisted store to the current model version.

To modify a program:

  1. Select Model.xcdatamodeld
  2. Click Editor > Add Model Version ...
  3. Click Finish to use Model 2 as the version name by default

  

  

  

Note that we are going to revise the new template and slowly get to the point:

  1. Note the Backup program
  2. Select Model 2.xcdatamodel
  3. As with 3.1, create the entity measurement and create a string-type property on it ABC
  4. Select Model.xcdatamodeld, and then click menu View > Utilities > Show File Inspector to set current model Version to model 2, or modify as shown above

After configuring this, you also need to set the migration options to tell the core data how it should be migrated, and now run the program, which is sure to have a 3.1 error.

3.2. Add a template version (Core Data Application Practice Guide)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.