Function

ODQueryCreateWithNodeType(_:_:_:_:_:_:_:_:_:)

Creates a query for a particular node type using provided parameters.

Declaration

func ODQueryCreateWithNodeType(_ allocator: CFAllocator!, _ nodeType: ODNodeType, _ recordTypeOrList: CFTypeRef!, _ attribute: String!, _ matchType: ODMatchType, _ queryValueOrList: CFTypeRef!, _ returnAttributeOrList: CFTypeRef!, _ maxResults: CFIndex, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<ODQueryRef>!

Parameters

inAllocator

The memory allocator to use. If NULL, the default allocator is used.

inType

The node type.

inRecordTypeOrList

The type or types of record to query. Can be a CFString object for a single type or a CFArray object containing CFString objects for multiple types.

inAttribute

The name of the attribute to query.

inMatchType

The type of query.

inQueryValueOrList

The value or values to query in the attribute. Can be a CFString object or a CFData object for a single value, or a CFArray containing CFString and CFData objects for multiple values.

inReturnAttributeOrList

The attribute or attributes to be returned from the query. Can be a CFString object for a single attribute or a CFArray object containing CFString objects for multiple attributes. Passing NULL is equivalent to passing kODAttributeTypeStandardOnly.

inMaxResults

The maximum number of values to be returned.

outError

An error reference for error details. Can be NULL.

Return Value

The created query.

See Also

Working with Queries

func ODQueryGetTypeID() -> CFTypeID

Returns the type ID for an Open Directory query.

func ODQueryScheduleWithRunLoop(ODQueryRef!, CFRunLoop!, CFString!)

Retrieves results from a query asynchronously by scheduling the query in a run loop.

func ODQuerySetDispatchQueue(ODQueryRef!, DispatchQueue!)

Retrieves results from a query asynchronously by adding the query to a dispatch queue.

func ODQuerySynchronize(ODQueryRef!)

Restarts a query, disposing of any results it has obtained.