Instance Property


An array containing the query’s results.


var results: [Any] { get }


The 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, use the resultCount and result(at:) methods.

The array supports Key-value observing, which can be used to be notified when items are added, removed, or updated in the array of results.

By default, this array contains NSMetadataItem objects, each of which represents the metadata associated with a file. However, the query’s delegate can substitute these objects with instances of a different class.

See Also

Related Symbols

var groupedResults: [NSMetadataQueryResultGroup]

An array containing hierarchical groups of query results. (read-only)