Databases Reference
In-Depth Information
Figure 7—Version error on iOS
Your First Data Model Version
When you first set up versioning, be sure to look inside the target in Xcode and update
the Compile Sources section. If you do not see the .xcdatamodeld file inside the target,
remove the xcdatamodel references from it and drag the entire xcdatamodeld bundle into
the target. Otherwise, your application may complain about being unable to merge
entities because it will treat each version of the model as an independent model.
Once this change has been completed, it is best to clean the project (delete any pre-
viously compiled code) by choosing Product > Clean from the main menu.
v1.xcdatamodel and v2.xcdatamodel . Next, we need to select the PPRecipes.xcdatamodeld
file and open the File Inspector Utility View ( DE 1). In the utility view, you'll
see a Versioned Core Data Model section. (The Xcode templates have been
bouncing back and forth on this issue over the past few versions. It is possible,
depending on when you created your project, that you already have a versioned
data model.) Inside of that section is a Current option, allowing us to select
which model file is the current one. Make sure it references v2, as shown in
Figure 8, Setting the current model version , on page 41 .
 
 
 
Search WWH ::




Custom Search