Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSMetadataQueryMBS class.
NSMetadataQueryMBS.Constructor
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSMetadataQueryMBS.disableUpdates
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You should invoke this method before iterating over query results that could change due to live updates.
NSMetadataQueryMBS.enableUpdates
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You should invoke this method after you're done iterating over the query results.
NSMetadataQueryMBS.groupedResults as NSMetadataQueryResultGroupMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSMetadataQueryMBS.groupingAttributes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSMetadataQueryMBS.indexOfResult(item as NSMetadataItemMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSMetadataQueryMBS.isGathering as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true when the query is in the initial gathering phase; false otherwise.
NSMetadataQueryMBS.isStarted as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true when the receiver has executed the startQuery method; false otherwise.
NSMetadataQueryMBS.isStopped as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true when the receiver has stopped the query, false otherwise.
NSMetadataQueryMBS.notificationBatchingInterval as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
in seconds.
(Read and Write computed property)
NSMetadataQueryMBS.predicate as NSPredicateMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Setting the predicate on a receiver running a query causes the existing query to stop, all current results are discarded, and a new query is started immediately.
(Read and Write computed property)
NSMetadataQueryMBS.resultAtIndex(index as Integer) as NSMetadataItemMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
index: Index of the desired result in the query result array.
Returns query result at the position specified by index.
For performance reasons, you should use this method when retrieving a specific result, rather than they array returned by results.
NSMetadataQueryMBS.resultCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
For performance reasons, you should use this method, rather than invoking count on results array.
NSMetadataQueryMBS.results as NSMetadataItemMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The results array is a proxy object that is primarily intended for use with Cocoa bindings. While it is possible to copy the proxy array and receive a "snapshot" of the complete current query results, it is generally not recommended due to performance and memory issues. To access individual result array elements you should instead use the resultCount and resultAtIndex methods.
NSMetadataQueryMBS.searchScopes as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The array can contain strings that represent file system directories or the search scopes specified in Constants. An empty array indicates that there is no limitation on where the receiver searches.
NSMetadataQueryMBS.setGroupingAttributes(attributeNames() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Invoking this method on a receiver while it's running a query, stops the query and discards current results, and immediately starts a new query.
Available in Mac OS X v10.4 and later.
NSMetadataQueryMBS.setSearchScopes(folders() as folderitem)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You can pass paths as folderitem.
See also:
Some examples using this method:
NSMetadataQueryMBS.setSearchScopes(paths() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You can pass paths as strings and with the string array also the special scope strings from this class.
See also:
NSMetadataQueryMBS.setSearchScopes(paths() as string, folders() as folderitem)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You can pass paths as strings, paths as folderitem and with the string array also the special scope strings from this class.
See also:
NSMetadataQueryMBS.setSortDescriptor(sortDescriptor as NSSortDescriptorMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Invoking this method on the receiver running a query causes the existing query to stop, all current results are discarded, and a new query is started immediately.
NSMetadataQueryMBS.setSortDescriptors(sortDescriptors() as NSSortDescriptorMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Invoking this method on the receiver running a query causes the existing query to stop, all current results are discarded, and a new query is started immediately.
NSMetadataQueryMBS.sortDescriptors as NSSortDescriptorMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Available in Mac OS X v10.4 and later.
NSMetadataQueryMBS.startQuery as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true when successful; false otherwise.
A query can't be started if the receiver is already running a query or no predicate has been specified.
Some examples using this method:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The receiver first completes gathering any unprocessed results. If a query is stopped before the gathering phase finishes, it will not post an NSMetadataQueryDidStartGatheringNotification notification.
You would call this function to stop a query that is generating too many results to be useful but still want to access the available results. If the receiver is sent a startQuery message after performing this method, the existing results are discarded.
The items on this page are in the following plugins: MBS MacCloud Plugin.