By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
23 | TYPO | “Instead of having an add” logic path and anedit’’ logic path” Excerpt From: Marcus S. Zarra. “Core Data in Swift (for Don Sleeter).” iBooks. | 2016-03-28 | ||
27 | TYPO | The period is missing from the statement: ingredient setValue(recipe, forKey:“recipe”) | 2016-03-28 | ||
41 | ERROR | The code is shown for this method: canEditRowAtIndexPath But the text describes this method: cellForRowAtIndexPath The second one is far more useful, and if the edit method has some relationship to the use of the FRC, then it would be helpful to document both methods. | 2016-03-28 | ||
42 | ERROR | This text: “there are two case statements” likely refers to something (I’m guessing) from the Objective-C version of the book. It should read “the default case…” | 2016-03-28 | ||
all | SUGGEST | It would be nice if the book could explain what (if any) gotchas or special techniques are used/necessary to handle a recursive tree-structured object model in Core Data. The only mention of recursion I find is in the JSON conversion section. | 2016-03-30 | ||
all | SUGGEST | Similar to the choice between using Interface Builder vs creating the UI in code, it would be nice if the book could address building object models in code rather than using Xcode to define the model. Is this even possible? | 2016-03-30 | ||
12 | ERROR | The text states: Note that the block accepts both an NSString and an NSError pointer. The Swift code its accepting a String and throws an error. | 2016-03-28 | ||
22 | ERROR | The methods for configuring the persistent store are all described as Obj-C methods, not Swift methods. Such as “The last parameter, error, is used when something goes wrong with the addition of the NSPersistentStore.” Being this is Swift, we aren’t passing in a pointer but are wrapping the cal with the do-try-catch syntax. | 2016-03-28 | ||
46 | TYPO | The books list the GitHub path to be github.com/mzarra/ZDS_Shared but it ends up being redirected to github.com/mzarra/MSZ_Shared. Not that it doesn’t work, just a bit confusing. | 2016-03-28 | ||
47 | TYPO | The second method in the public API for the ZSContextWatcher should be The second method in the public API for the MSZContextWatcher | 2016-03-28 | ||
51 | ERROR | When running the sample code in the PPRecipes folder, the Add Recipe screen already contains the Last Used and Author attributes. Attempting to manipulate either of those is causing an NSInternalInconsistencyException to be thrown. (‘NSFetchRequest could not locate an NSEntityDescription for entity name ’Author’). | 2016-03-29 | ||
58 | ERROR | The text in the “Turning on Automatic Data Migration” states: To do this, we need to make a small change to the persistentStoreCoordinator method in our AppDelegate. The code to manage the PSC is in PPRDataController, not the AppDelegate. Also these method listed is showing it in Obj-C selector form, not Swift. | 2016-03-28 | ||
65 | TYPO | The text currently reads: NSEntityMigrationPolicy is designed to be subclasses so that we can override all or part of the migration. Should read: NSEntityMigrationPolicy is designed to be subclassed so that we can override all or part of the migration. | 2016-03-28 | ||
64 | TYPO | Currently reads: Next, we need to modify the RecipeIngredientToRecipeIngredient. Should read: Next, we need to modify the RecipeIngredientToRecipeIngredient mapping. | 2016-03-28 | ||
82 | ERROR | The section “How to Load Property Values and NSManagedObjectID Objects” shows sample code which is the exact same code described on page 80 to load just the managed object ids: let request = NSFetchRequest(entityName: “Person”) | 2016-03-28 | ||
83 | SUGGEST | The text reads: It is far more efficient for us to use that NSPredicate against a collection that is already in memory. It seems to me that it should be: It is far more efficient for us to use an NSPredicate against a collection that is already in memory. The references “that NSPredicate” but we haven’t really been talking about an NSPredicate at this point. | 2016-03-28 | ||
94 | SUGGEST | The text states: In addition to object handle off between queues (the passing of an object ref- erence from one queue to another)… I’m thinking that you actually mean: In addition to object hand off between queues (the passing of an object ref- erence from one queue to another)… | 2016-03-28 | ||
95 | TYPO | let center = NSNotificationCenter.defaultCenter() appears twice, one right after each other, in the code snippet. | 2016-03-28 | ||
115 | TYPO | Errant period. Nothing gets loaded into memory and therefore the API is executed very quickly. just slightly slower than SQLite itself. Should be a comma before “just slightly slower” | 2016-03-28 | ||
131 | TYPO | The aggregsateNetworkCall(length: duration:) can use any system that makes sense to the business needs of the application. Should be aggregateNetworkCall( | 2016-03-28 | ||
121 | TYPO | fatalError(“Unexpected result frmo executeRequest”) “frmo” should be “from” | 2016-07-02 | ||
5 | TYPO | s/seques/segues/ | 2016-07-02 | ||
6 | TYPO | s/Unidetified/Unidentified/ | 2016-07-02 | ||
11 | SUGGEST | I would request that you make an effort to update the screenshots for this new edition. I am experiencing cognitive dissonance when I see screenshots with the look and feel of UIKit as it was before iOS 7, and seeing code in Swift. To me, those screenshots scream Objective-C and some readers (not me!) may question whether the content is really up to date when they see those screenshots. The same is also true for Xcode screenshots (see page 34 of the PDF). It is most striking when the one in page 62 is a modern Xcode screenshot. While I know that if the screenshot is maintained it is because it is still valid, it is quite distracting all the same. | 2016-07-02 | ||
127 | OK | I am getting a compiler error when I use “finished = true” in override func start: | 2016-07-02 | Please review the source code and you will find that the finished variable is overridden in the class file. | |
19 | OK | “What this means is that we can create a new controller that is a subclass of NSObject and place all of the Core Data related code into that controller.” Actually, it could well not be a subclass of NSObject. Making the controller an ObjC compatible object would have us losing potentially desirable Swift properties, like method overload, that are not available in ObjC. | 2016-07-02 | I tried that route and ended up keeping it an NSObject subclass to gain many of the benefits from KVO and notifications. | |
39 | OK | In prepareForEditRecipeNameSegue, in PPREditRecipeViewController, why not require the parameter type to be the type checked by the guard statement, and remove the need for the guard statement completely? I may not have read ahead enough if there is future reason for it, but as it is, it’s unnecessary type checking when the type system can do that for you. | 2016-07-02 | That would only move the guard up to the `prepareForSeque` which would be messy. | |
56 | TYPO | On pg 56 of PDF, .first is used to get the documentsURL, but on pg 57 the text says “We call ‘last’ on that array…” when describing the code. | 2016-07-02 | ||
4 | SUGGEST | The Storyboard screenshots appear not to be have been updated since pre-iOS 7 times. This can give the impression that the book is out of date which is not the case. Would be good if they can be redone using Xcode 7. | 2016-07-02 | ||
149 | ERROR | The description for MSZContextWatcher says: “The goal of the MSZContextWatcher is to provide us with the ability to monitor a subset of the data that is in Core Data and to be notified when it CHANGES. It’s the same functionality that is in the NSFetchedResultsController but not as tightly coupled with the UITableView.” yet the init method calls: center.addObserver(self, selector: “contextUpdated:”, not: center.addObserver(self, selector: #selector(contextUpdated(_:)), and so contextUpdated: is only called on a save, not when something is updated note: page number is for the ePub version as viewed in iBooks on the Mac using default viewing options | 2016-07-02 | ||
154 | ERROR | MSZContextWatcher uses the following test in its contextUpdated() method: if let insert = info?[NSInsertedObjectsKey] as? [NSManagedObject] { however, the user info passed by NSManagedObjectContextObjectsDidChangeNotification (see my previous erratum) does not include arrays of NSMangeObjects, but rather Sets of NSMangedObjects. Thus, the code within the if statement is never called. Instead, this check (and the other 2) should be: if let insert = info?[NSInsertedObjectsKey] as? Set note: page number is based on the ePub version as viewed in iBooks for Mac with default viewing options | 2016-07-02 | ||
4 | ERROR | Fresh download of the code, running in latest OS X, XCode 7.3.1. I open PRRecipes and build. In PPRMasterViewController.swift I get the following 5 errors (all the same one) ‘Cannot force unwrap value of non-optional type ’NSIndexPath’. Lines 159, 162, 166, 167, 170. Fixed by removing the exclamation from the ‘ip’ and ‘nip’. Build continues, iPhone 6s Plus simulator, iOS 9.3, on start I get ‘dyld_fatal_error’ dyld: Library not loaded: @rpath/libswiftCore.dylib Still pretty new to Swift, so this may be obvious, but not to me. It may be relevant that at one point I downloaded the latest XCode beta with Swift 3, but later deleted it and reinstalled the current xcode/ Swift 2.3 | 2016-11-29 | ||
4 | ERROR | Further to my first report, I can solve the dyld error by going to the project build settings and finding ‘Embedded Content Contains Swift Code’ and changing that from ‘no’ to ‘yes. I did that for both PRRecipes target and the project, then did a clean before retrying. Now the project starts in the simulator, but if it click on Type:Entree in the first screen I get an error ’Unidentified seque’ from PPREditRecipeViewController.swift line 86. Checking with the switch, I thought this should probably be ‘selectRecipeType’, so went to the storyboard, found that segue (which does indeed lack an identifier, and added that one in. saved the storyboard, clean and rebuild. Deleted app from simulator, ran again. This part now runs. Edit ingredients. Click Edit menu, this gives me an option ‘Add Ingredient’. I click on the green cross, and get a crash: <NSManagedObject 0x7fea8908cad0> valueForUndefinedKey:]: the entity RecipeIngredient is not key value coding-compliant for the key “ingredient”.’ | 2016-11-29 | ||
16 | TYPO | Let’s look at how that that (—> should be removed) data model was created. | 2016-11-29 | ||
50 | TYPO | Design > Data Model > Add Model Version This path appears to be wrong. The correct path for Xcode 7 and Xcode 8 would be: The same is true for page 30: | 2016-11-29 | ||
98 | TYPO | In the code, the description of the last fatalError should be “To-one relationship with malformed JSON” instead of “To-many relationship with malformed JSON” | 2016-11-29 | ||
19 | TYPO | In the code at the top of the page, the URLsForDirectory method calls ‘first’ on the array. In the text below, that is explaining the code, says that we are to call ‘last’ on the array. A) One of these is a typo B) Can you reply with what the correct answer is and why? Thanks! Great book! | 2016-11-29 | ||
143 | ERROR | The OSx version (in the PPRecipies project under shared/desktop), it crashes when starting up with the following error. [<PPRecipes.PPRDataController 0x608000063280> valueForUndefinedKey:]: this class is not key value coding-compliant for the key managedObjectContext. | 2016-11-29 | ||
143 | ERROR | To fix #80650 error, change mainContext to managedObjectContext (or change all of the links). Then it will work. All of the links in the nib file still think the mainContext is called managedObjectContext. | 2016-11-29 | ||
1 | ERROR | Running from downloaded source code with no changes: fatal error: Unidentified segue: file /Users/username/Downloads/code/PPRecipes/PPRecipes/PPREditRecipeViewController.swift, line 86 Exact line of code in program is: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | 2016-11-29 | ||
1 | ERROR | Running PPRecipes on iPhone6s Plus. Steps: Recipes -> ‘’ -> Ingredients -> Edit -> ’’ Add Ingredient Traceback Error: 2016-09-13 05:42:40.259 PPRecipes[3085:295396] Can’t find keyplane that supports type 4 for keyboard iPhone-PortraitTruffle-NumberPad; using 675849259_PortraitTruffle_iPhone-Simple-Pad_Default * First throw call stack: | 2016-11-29 | ||
1 | ERROR | Downloaded from source code, PPRecipes, error thru: Recipes -> ‘’ -> Ingredients -> Edit -> ’’ Add Ingredient Traceback: 2016-09-14 03:41:15.698 PPRecipes[4995:401145] * Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<__NSCFString 0x7fb13a554480> valueForUndefinedKey:]: this class is not key value coding-compliant for the key unitOfMeasure.’ * First throw call stack: | 2016-11-29 | ||
43-44 | TYPO | The book section entitled “Building Our Own: MSZContextWatcher”, subsection “init()”, adds an observer for NSManagedObjectContextObjectsDidChangeNotification (In Swift 3.0 it would be NSManagedObjectContextObjectsDidChange). the change notification is also in the source code. I am conflicted by a subsequent subsection in the book entitled “contextUpdated()” that states: “Now when we receive a notification from an NSManagedObjectContextDidSaveNotification”. This caught me by surprise because I would have expected the same NSNotification. I am asking here for definitive clarification with the hope that this may help the book. Sure hope I am not being completely oblivious. | 2016-11-29 | ||
29 | ERROR | let results = [NSManagedObject]? = nil | |||
36 | SUGGEST | In Chapter 2, section Loading the Data Model, the data controller is described as being a subclass of NSObject but the code downloaded from the pragmatic bookshelf website (dated January 3 in the subfolder PPRecipes) is not a subclass of NSObject. The downloaded code does compile and run, so it’s not clear why the Controller described in the book needs to inherit from NSObject. Also note that the website requires a page number but I’m using the epub version where pagination depends on window size. |