<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/ODQueryDelegate/query(_:foundResults:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Open Directory"
    ],
    "preciseIdentifier" : "c:objc(pl)ODQueryDelegate(im)query:foundResults:error:"
  },
  "title" : "query(_:foundResults:error:)"
}
-->

# query(_:foundResults:error:)

The delegate method called as results are returned from a query scheduled in a run loop.

```
func query(_ inQuery: ODQuery!, foundResults inResults: [Any]!, error inError: (any Error)!)
```

## Parameters

`inQuery`

The query.

`inResults`

Partial results returned from the query.

`inError`

An error reference for error details.

## Discussion

This method is called as soon as any results become available. Results must be retained or copied. If both `inResults` and `inError` are `nil`, the query has completed.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)