---
title: "ODQueryCopyResults(_:_:_:)"
framework: opendirectory
role: symbol
role_heading: Function
path: "opendirectory/odquerycopyresults(_:_:_:)"
---

# ODQueryCopyResults(_:_:_:)

Returns results from a query synchronously.

## Declaration

```swift
func ODQueryCopyResults(_ query: ODQueryRef!, _ allowPartialResults: Bool, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<CFArray>!
```

## Parameters

- `query`: The query.
- `allowPartialResults`: If true, only immediately available results are returned; otherwise, the function waits until all results are available.
- `error`: An error reference for error details. Can be NULL.

## Return Value

Return Value The results of the query in an array of ODRecord objects.

## See Also

### Working with Queries

- [ODQueryCreateWithNode(_:_:_:_:_:_:_:_:_:)](opendirectory/odquerycreatewithnode(_:_:_:_:_:_:_:_:_:).md)
- [ODQueryCreateWithNodeType(_:_:_:_:_:_:_:_:_:)](opendirectory/odquerycreatewithnodetype(_:_:_:_:_:_:_:_:_:).md)
- [ODQueryGetTypeID()](opendirectory/odquerygettypeid().md)
- [ODQueryScheduleWithRunLoop(_:_:_:)](opendirectory/odqueryschedulewithrunloop(_:_:_:).md)
- [ODQuerySetCallback(_:_:_:)](opendirectory/odquerysetcallback(_:_:_:).md)
- [ODQuerySetDispatchQueue(_:_:)](opendirectory/odquerysetdispatchqueue(_:_:).md)
- [ODQuerySynchronize(_:)](opendirectory/odquerysynchronize(_:).md)
- [ODQueryUnscheduleFromRunLoop(_:_:_:)](opendirectory/odqueryunschedulefromrunloop(_:_:_:).md)
