O'Reilly logo

Learn Objective-C on the Mac by Scott Knaster, Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17

NSPredicate

a fairly common operation when writing software is to take a collection of objects and evaluate them against some kind of known truth. You hang on to objects that conform to the truth and throw out objects that don't, leaving you with a pile of interesting objects to play with.

You see this all the time with software you use, like iPhoto. If you tell iPhoto to show you only pictures with a rating of three stars or better, the truth you've specified is "photo must have a rating of three stars or better." All of your photos are run through this filter. Those that have a rating of three or more stars pass through it, and the rest don't. iPhoto then shows you all your good pictures.

Similarly, iTunes has its search box. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required