Class

NSCompoundPredicate

A specialized predicate that evaluates logical combinations of other predicates.

Declaration

@interface NSCompoundPredicate : NSPredicate

Overview

Use NSCompoundPredicate to create an AND or OR compound predicate of zero or more other predicates, or the NOT of a single predicate. For the logical AND and OR operations:

  • An AND predicate with no subpredicates evaluates to YES.

  • An OR predicate with no subpredicates evaluates to NO.

  • A compound predicate with one or more subpredicates evaluates to the truth of its subpredicates.

Topics

Constructors

+ andPredicateWithSubpredicates:

Returns a new predicate formed by AND-ing the predicates in a given array.

+ notPredicateWithSubpredicate:

Returns a new predicate formed by NOT-ing a given predicate.

+ orPredicateWithSubpredicates:

Returns a new predicate formed by OR-ing the predicates in a given array.

- initWithType:subpredicates:

Returns the receiver initialized to a given type using predicates from a given array.

Getting Information About a Compound Predicate

compoundPredicateType

The predicate type for the receiver.

subpredicates

The receiver’s subpredicates.

Constants

NSCompoundPredicateType

These constants describe the possible types of NSCompoundPredicate.

Initializers

Relationships

Inherits From

See Also

Filtering

NSPredicate

A definition of logical conditions used to constrain a search either for a fetch or for in-memory filtering.

NSExpression

An expression for use in a comparison predicate.

NSComparisonPredicate

A specialized predicate that you use to compare expressions.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software