Filters and Sorting

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

Topics

Filtering

class NSPredicate

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

class NSExpression

An expression for use in a comparison predicate.

class NSComparisonPredicate

A specialized predicate that you use to compare expressions.

class NSCompoundPredicate

A specialized predicate that evaluates logical combinations of other predicates.

Sorting

class NSSortDescriptor

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

enum ComparisonResult

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.