Platforms to show: All Mac Windows Linux Cross-Platform

NSPredicateMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class iCloud MBS MacCloud Plugin 11.3 Yes No No Yes, macOS only No
Function: The NSPredicate class is used to define logical conditions used to constrain a search either for a fetch or for in-memory filtering.
You use predicates to represent logical conditions, used for describing objects in persistent stores and in-memory filtering of objects. Although it is common to create predicates directly from instances of NSComparisonPredicate, NSCompoundPredicate, and NSExpression, you often create predicates from a format string which is parsed by the class methods on NSPredicate. Examples of predicate format strings include:

  • Simple comparisons, such as grade == "7" or firstName like "Shaffiq"
  • Case and diacritic insensitive lookups, such as name contains[cd] "itroen"
  • Logical operations, such as (firstName like "Mark") OR (lastName like "Adderley")
  • In Mac OS X v10.5 and later, you can create €œbetween€ predicates such as date between {$YESTERDAY, $TOMORROW}.

You can create predicates for relationships, such as:

  • like "work*"
  • ALL children.age > 12
  • ANY children.age > 12

You can create predicates for operations, such as @sum.items.price < 1000. For a complete syntax reference, refer to the Predicate Programming Guide:

Feedback, Comments & Corrections

Sub classes:

Some methods using this class:

Some properties using for this class:

Some events for this class:

Some examples which use this class:

Blog Entries

The items on this page are in the following plugins: MBS MacCloud Plugin.

NSPopUpButtonMBS   -   NSPrinterMBS

The biggest plugin in space...

MBS FileMaker blog