Who Should Read This Document?
Organization of This Document
Predicates provide a general means of specifying queries in Cocoa. The predicate system is capable of handling a large number of domains, not just—for example—Core Data or Spotlight. This document describes predicates in general, their use, their syntax, and their limitations.
You should read this document if your application needs to filter objects or to set up queries retrieving objects using Core Data.
The following articles explain the basics of predicates in Cocoa, explain how to create and use predicate objects, and define the predicate syntax:
“Predicate Basics” describes the fundamental aspects of the technology.
“Creating Predicates” describes how to correctly instantiate predicates programmatically and how to retrieve them from a managed object model.
“Using Predicates” explains how to use predicates and discusses some issues related to performance.
“Comparison of NSPredicate and Spotlight Query Strings” compares NSPredicate and Spotlight queries.
“Predicate Format String Syntax” describes the syntax of the predicate format string.
“BNF Definition of Cocoa Predicates” provides a definition of Cocoa predicates in Backus-Naur Form notation.
© 2005, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-06)