Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

9. Migrating and Optimizing with Core Da... > Everything stems from our object mod...

Everything stems from our object model

So now you’ve figured out that the Fugitive entity needs a few more fields: the date and time, and something to indicate whether the fugitive has been captured. The database is built from the data model, so we can just update the data model to add the information we need. The Core Data date type includes both a date and time, so we only need two more properties on our Fugitive entity:

image with no caption

Exercise

Update the data model with the new captured fields.

Use the data model editor to update the model with the two new fields.

After you update the model, you’ll need to delete the two old fugitive class files and generate new ones with the new fields included.

Exercise Solution

Use the tools that Xcode comes with to quickly make those changes.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial