Filters and Sorting

Use predicates, expressions, and sort descriptors to examine elements in collections and other services.

Topics

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.

NSCompoundPredicate

A specialized predicate that evaluates logical combinations of other predicates.

Sorting

NSSortDescriptor

An immutable description of how to order a collection of objects based on a property common to all the objects.

NSComparisonResult

Constants that indicate sort order.

See Also

Fundamentals

Numbers, Data, and Basic Values

Work with primitive values and other fundamental types used throughout Cocoa.

Strings and Text

Create and process strings of Unicode characters, use regular expressions to find patterns, and perform natural language analysis of text.

Collections

Use arrays, dictionaries, sets, and specialized collections to store and iterate groups of objects or values.

Dates and Times

Compare dates and times, and perform calendar and time zone calculations.

Units and Measurement

Label numeric quantities with physical dimensions to allow locale-aware formatting and conversion between related units.

Data Formatting

Convert numbers, dates, measurements, and other values to and from locale-aware string representations.