small medium large xlarge

Back to: All Forums  Core Data
14 Feb 2010, 15:27
Andrew W. Donoho (4 posts)


I am not an SQL DB programmer. One of the virtues of Core Data is that it is NOT SQL.

Hence, I am so surprised that there is such a dearth of documentation for one of the key technologies - NSPredicate - behind Core Data. “Core Data” devotes only one page, page 61 in my electronic version, to NSPredicate. (WoW, I am so disappointed that “Core Data” explains so little about this key technology. It really makes me lament purchasing “Core Data”.) Apple’s documentation, “Predicate Programming Guide”, recommended in “Core Data,” is just lame. It doesn’t address most of the NSPredicate keywords nor explains anything about how to make complex queries over to-many relationships. It does tell me that to-many queries, from a performance perspective, are an “expensive” operation. OK. That isn’t the same as telling me how to write NSPredicate join queries. What a missed opportunity for both the author and publisher of “Core Data”. Answering my query with “go learn SQL”, with SQL’s table centric model, is a dramatically poor answer for Core Data, with it’s object graph model. I am so disappointed in “Core Data”.

The Google is not terribly helpful. That is part of why I bought “Core Data”.

Please point me in a direction towards a decent NSPredicate reference.


14 Feb 2010, 17:37
Marcus S. Zarra (284 posts)

One thing to remember is that NSPredicate is NOT a Core Data technology. It existed before Core Data and is used outside of Core Data. While I am seriously considering adding a full chapter about it in the next revision, the reason it was left out is because it was outside of the focus of the book. If I included every orbital framework that Core Data touches I would have to explore nearly every framework in Cocoa.

I would suggest reading the plethora of documentation that Apple provides on this subject.

“Predicate Programming Guide”:

This is probably one of the more extensively covered APIs by Apple.

15 Feb 2010, 14:43
Andrew W. Donoho (4 posts)


Thank you for replying.

That said, leaving a full discussion of NSPredicate out of your book, one of the major components that go into a NSFetchRequest, is a huge oversight. That this technology predated Core Data is an extremely poor reason to leave it out of your book. I am just a consumer of your product. I bought your book to learn what I need to know to use Core Data. What I found was a huge omission of the key query language used in the technology. Could you leave a discussion of the WHERE clause of a SQL book? That is the equivalent what you did in “Core Data”.

That you repeat the same recommendation as you made in the book, and which is a poorly implemented document, is not terribly helpful. Have you nothing better? Or is this a demonstration of your pedagogical oversight? You sold a book covering “Apple’s API for Persisting Data on Mac OS X” and left the query language out of it. Stunning! It is immaterial to this consumer that NSPredicate has extensive but poorly implemented documentation. Apple’s documents leave a huge amount of information out. For example, SUBQUERY is supported on iPhone OS 3.0. There is one discussion of this expression and it isn’t in the lame reference you recommended.

NSPredicate is key to using Core Data and you left it out of your book. I feel so suckered and stupid to have purchased your book.


18 Feb 2010, 00:45
Greg Robertson (21 posts)

I really appreciate the Core Data book and have used it alot but I have to agree with Andrew that NSPredicate is so important to pulling data from a Core Data store and the Apple docs so poor that I too was hoping for more in your book. Although I now feel I have a fairly good handle on NSPredicate basics some aspects such as the SUBQUERY I found so poorly documented that I was not able to utilize it and re-wrote my NSPredicates to avoid them.

Looking back at my previous posts I can see most of them were NSPredicate quetions.

I would definitely purchase your book again if it had a good chapter or two on NSPredicate, and I am very happy with many other aspects such as versioning which I found very well explained.

Just my two cents.


18 Feb 2010, 01:11
Marcus S. Zarra (284 posts)

Unfortunately there is no way to go back and add the chapter to the first printing of the book but as I mentioned above, I am seriously considering adding it to the next revision as I agree that it is a very important framework.

You must be logged in to comment