Chapter 2: Getting Started with Core Data

Chapter 2 kicks off the book’s example, a simple application to keep track of recipes with their ingredients and perhaps a photo of the completed dish. This chapter gives the first of the three versions of the application, with a very simple data model. The next two versions expand and improve the data model, as is typical of the application development process, which requires versioning and a data migration process, covered in Chapter 5.

I entered the application and it seemed to run, but when I opened it a second time, the recipes I created the previous time were gone. Since the disk file uses an XML format, I was able to read the app’s file in ~/Library/Application Support, and saw that the information I had added was there, it just wasn’t getting loaded in a subsequent run.

I posted a question about this issue on the book’s forum, and then decided to check the nib (.xib) fie. I found that I hadn’t checked the “Prepares Content” box for the Recipes array controller, which tells the controller to load the data from the managed object context when the nib loads. I then promptly answered my own question before anyone else had jumped in. Hopefully nobody got ticked off over the wasted bandwidth.

Advertisements
This entry was posted in Core Data and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s