MDQuery
Overview
MDQuery is a CF-compliant object, follows the CF conventions,and can be used with the CF polymorphic functions, such as CFRetain.MDQuery encapsulates queries against the System store of the filemetadata.
An MDQuery normally executes asynchronously and posts progressnotifications as the results are collected. During the gatheringphase the query results conform to the specified value lists andsorting.
MDQuery gathers results and processes updates only while thecurrent thread's run loop is running.
For functions that take an MDQueryRef parameter, if this parameteris not a valid MDQueryRef, the behavior is undefined. NULL isnot a valid MDQueryRef.
For functions that take CF*Ref parameters, such as CFStringRefand CFArrayRef, if this parameter is not a valid CF object of thecorrect type, the behavior is undefined. NULL isnot a valid CF*Ref.
Topics
Creating Queries
MDQueryCreate(_:_:_:_:)MDQueryCreateSubset(_:_:_:_:_:)MDQuerySetSearchScope(_:_:_:)MDQuerySetDispatchQueue(_:_:)
Getting and Setting Query Parameters
MDQuerySetMaxCount(_:_:)MDQueryGetBatchingParameters(_:)MDQuerySetBatchingParameters(_:_:)MDQueryCopyValueListAttributes(_:)MDQueryCopySortingAttributes(_:)MDQueryCopyQueryString(_:)
Setting Callback Functions
MDQuerySetCreateResultFunction(_:_:_:_:)MDQuerySetSortComparator(_:_:_:)MDQuerySetCreateValueFunction(_:_:_:_:)
Starting, Stopping and Pausing Queries
MDQueryExecute(_:_:)MDQueryStop(_:)MDQueryDisableUpdates(_:)MDQueryEnableUpdates(_:)MDQueryIsGatheringComplete(_:)
Getting Query Result Values
MDQueryCopyValuesOfAttribute(_:_:)MDQueryGetAttributeValueOfResultAtIndex(_:_:_:)MDQueryGetCountOfResultsWithAttributeValue(_:_:_:)MDQueryGetIndexOfResult(_:_:)MDQueryGetResultAtIndex(_:_:)MDQueryGetResultCount(_:)MDQuerySetSortComparatorBlock(_:_:)