<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/ODQuerySetCallback(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Open Directory"
    ],
    "preciseIdentifier" : "c:@F@ODQuerySetCallback"
  },
  "title" : "ODQuerySetCallback(_:_:_:)"
}
-->

# ODQuerySetCallback(_:_:_:)

Sets the callback for an asynchronous query.

```
func ODQuerySetCallback(_ query: ODQueryRef!, _ callback: ODQueryCallback!, _ userInfo: UnsafeMutableRawPointer!)
```

## Parameters

`query`

The query.

`callback`

The callback function.

`userInfo`

A user-defined pointer to be passed back to the callback function.

## See Also

[`ODQueryCallback`](/documentation/OpenDirectory/ODQueryCallback)

A callback function called as results from a scheduled query are returned.



---

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)