Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPredicateMBS class.

NSPredicateMBS.predicateWithFormat(predicateFormat as string) as NSPredicateMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method iCloud MBS MacCloud Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns a new predicate by substituting the values in a given array into a format string and parsing the result.
Example
dim n as NSPredicateMBS
n = NSPredicateMBS.predicateWithFormat("kMDItemContentType=""com.apple.application-bundle""")
MsgBox n.predicateFormat

predicateFormat: The format string for the new predicate.
arguments: Optional, the arguments to substitute into predicateFormat. Values are substituted into predicateFormat in the order they appear in the array.

Returns a new predicate by substituting the values in arguments into predicateFormat, and parsing the result.
For details of the format of the format string and of limitations on variable substitution, see Predicate Format String Syntax:
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html#//apple_ref/doc/uid/TP40001795

Available in Mac OS X v10.4 and later.

See also:

Some examples using this method:

NSPredicateMBS.predicateWithFormat(predicateFormat as string, arguments() as Variant) as NSPredicateMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method iCloud MBS MacCloud Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns a new predicate by substituting the values in a given array into a format string and parsing the result.
Example
dim args() as Variant
args.Append NSMetadataItemMBS.NSMetadataItemFSNameKey
dim pred as NSPredicateMBS = NSPredicateMBS.predicateWithFormat("%K LIKE '*'", args)
MsgBox pred.description

predicateFormat: The format string for the new predicate.
arguments: Optional, the arguments to substitute into predicateFormat. Values are substituted into predicateFormat in the order they appear in the array.

Returns a new predicate by substituting the values in arguments into predicateFormat, and parsing the result.
For details of the format of the format string and of limitations on variable substitution, see Predicate Format String Syntax:
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html#//apple_ref/doc/uid/TP40001795

Available in Mac OS X v10.4 and later.

See also:

NSPredicateMBS.predicateWithValue(value as boolean) as NSPredicateMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method iCloud MBS MacCloud Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns a predicate that always evaluates to a given value.
Example
dim p as NSPredicateMBS = NSPredicateMBS.predicateWithValue(true)
MsgBox p.predicateFormat

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


The biggest plugin in space...