---
title: stop()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsmetadataquery/stop()
---

# stop()

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

## Declaration

```swift
func stop()
```

## Discussion

Discussion The receiver first completes gathering any unprocessed results. If a query is stopped before the gathering phase finishes, it does not post an NSMetadataQueryDidStartGatheringNotification notification. You call this function to stop a query that is generating too many results to be useful but you still want to access the available results. If the receiver is sent a startQuery message after performing this method, the existing results are discarded.

## See Also

### Running queries

- [isStarted](foundation/nsmetadataquery/isstarted.md)
- [start()](foundation/nsmetadataquery/start().md)
- [isGathering](foundation/nsmetadataquery/isgathering.md)
- [isStopped](foundation/nsmetadataquery/isstopped.md)
