By Developers, For Developers

Historical errata for Core Data in Objective-C, Third Edition

PDF PgPaper PgTypeDescriptionFixed onComments
123ERROR

Sample code PPRDataController line 77.
options dictionary is never declared (and of course never populated)

2016-03-16
82SUGGEST

“To demonstrate the differences in the ways that we can load data into memory from our SQLite Store, let’s look at an older Apple demonstration application from a previous WWDC called GoFetch. (The source code for this application is available as part of this book’s download.)”

I was not able to find this GoFetch application (nor the source code) in the downloadable source code archive (mzcd3-code.zip).

2016-07-03
29ERROR

The code sample (PPRDataController.m) contains an error. In method call addPersistentStoreWithType:configuration:URL:option:error, it references an object called “options” for the options argument, however the options object doesn’t exist. I looked at the raw source code media.pragprog.com/titles/mzcd3/code/RecipesV1/PPRecipes/PPRDataController.m and it doesn’t exist there either. Just a heads up!

2016-07-02
0ERROR

In addition to the compile error mentioned below, the sample app crashes at launch. This is because the code tries to load data from a non-existent file. They are all easy mistakes and show the author didn’t run his code before shipping it.

2016-07-02
0SUGGEST

It seems in many of places of the book where images are embedded, wrong image files are used.

2016-07-02
60ERROR

In Loading the Data Model in Chapter 2 (sorry, reading in iBooks and don’t see printed page numbers), it says “we call URLForResource:withExtension: using the name of our data model in this case PPRecipes”, yet in the code shown it is passed name “DatModel”.

2016-07-02
N/ATYPO

In file PPRDataController.m, in method initializeCoreData line 47, we initialize the modelURL with URLForResource:"DataModel". The correct initialization is URLForResource:“PPRecipes” to point the URL at the data model provided with the sample code.

I believe that this is what Kenichi is referring to as a “missing file”. The file is there, the URL just isn’t aimed at it. Change the line and the App starts up just fine.

2016-07-02
1ERROR

The provided code for “Recipes Ver 1” crashed when first run. Basic error, see below. Upate the provided code please, it creates a very poor first impression. Furthermore this is supposed to be the updated version 3 of the book, for iOS 9. This is not reflected in the (ancient) iOS ver 6(ish) user interface of the sample app….

2016-06-28 16:28:46.615 PPRecipes[3774:2077393] * Assertion failure in -[PPRDataController initializeCoreData]
2016-06-28 16:28:46.622 PPRecipes[3774:2077393] * Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Failed to locate momd in app bundle’

* First throw call stack:
(0x181d9adb0 0x1813fff80 0x181d9ac80 0x182720154 0x10003f844 0x10003f644 0x100047e7c 0x186f6e9c0 0x18719e184 0x1871a25f0 0x18719f764 0x18373b7ac 0x18373b618 0x18373b9c8 0x181d5109c 0x181d50b30 0x181d4e830 0x181c78c50 0x186f6794c 0x186f62088 0x1000325dc 0x1818168b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

2016-07-02
107TYPO

.. kick of a save on the private contact …
should be
.. kick of a save on the private context …
?

29-30ERROR

Under “Stored Fetch Requests” the x-code compiler utilizes “Editor” not design to access Add Fetch Request or Add Fetched Property. The screenshot on page 30 uses “bigMeals” as the fetch request template, while the template name in the code example is “allIngredients”. It would be nice to have clarification that the fetch request and template are one in the same. PS the box on 31 is nice clarification between fetch requests and fetched properties.

Categories: