Instance Method


Attempts to start the query.


func start() -> Bool

Return Value

true when successful; otherwise, false.

A query may fail to start if it does not specify a predicate, or if the query has already been started.


A query can’t be started if the receiver is already running a query or no predicate has been specified.

This method must be called from the receiver’s operationQueue or on the main thread. For example:

let query: NSMetadataQuery = // Initialize and set up a query
    query.operationQueue?.addOperationWithBlock {

See Also

Related Symbols

var isStarted: Bool

A Boolean value that indicates whether the query has started. (read-only)

func stop()

Stops the receiver’s current query from gathering any further results.