The NSPredicate class is used in Mac OS X and iOS development to define logical conditions used to constrain a search either for a fetch or for in-memory filtering.
The NSPredicate
class is used in Mac OS X and iOS development to define logical conditions used to constrain a search either for a fetch or for in-memory filtering.
An example predicate:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(lastName like[cd] %@) AND (birthday > %@)", lastNameSearchString, birthdaySearchDate];
Multiple predicates can be combined into a more complex predicate with NSCompoundPredicate
.
Full reference available in Apple's docs for NSPredicate
. Also refer to the Predicate Programming Guide.