Class

NSComparisonPredicate

A specialized predicate that you use to compare expressions.

Declaration

@interface NSComparisonPredicate : NSPredicate

Overview

You use comparison predicates to compare the results of two expressions. You create a comparison predicate with an operator, a left expression, and a right expression. You represent the expressions using instances of the NSExpression class. When you evaluate the predicate, it returns as a BOOL value the result of invoking the operator with the results of evaluating the expressions.

Topics

Creating Comparison Predicates

Displaying Searchable Content by Using a Search Controller

Create a user interface with searchable content in a table view.

+ predicateWithLeftExpression:rightExpression:customSelector:

Returns a new predicate formed by combining the left and right expressions using a given selector.

+ predicateWithLeftExpression:rightExpression:modifier:type:options:

Creates and returns a predicate of a given type formed by combining given left and right expressions using a given modifier and options.

- initWithLeftExpression:rightExpression:customSelector:

Initializes a predicate formed by combining given left and right expressions using a given selector.

- initWithLeftExpression:rightExpression:modifier:type:options:

Initializes a predicate to a given type formed by combining given left and right expressions using a given modifier and options.

Getting Information About a Comparison Predicate

comparisonPredicateModifier

The comparison predicate modifier for the receiver.

customSelector

The selector for the receiver.

rightExpression

The right expression for the receiver.

leftExpression

The left expression for the receiver.

options

The options that are set for the receiver.

predicateOperatorType

The predicate type for the receiver.

Constants

NSComparisonPredicateModifier

These constants describe the possible types of modifier for NSComparisonPredicate.

NSComparisonPredicateOptions

These constants describe the possible types of string comparison for NSComparisonPredicate. These options are supported for LIKE as well as all of the equality/comparison operators.

NSPredicateOperatorType

Defines the type of comparison for NSComparisonPredicate.

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.

NSCompoundPredicate

A specialized predicate that evaluates logical combinations of other predicates.