Instance Method

resultAtIndex:

Returns the query result at a specific index.

Declaration

- (id)resultAtIndex:(NSUInteger)idx;

Parameters

index

The index of the desired result in the query result array.

Return Value

The query result at the position specified by index. By default, this method returns an NSMetadataItem object representing the requested result; however, the query’s delegate can substitute this object with an instance of a different class.

Discussion

For performance reasons, use this method when retrieving a specific result, rather than the array returned by results.

See Also

Getting Query Results

results

An array containing the query’s results.

resultCount

The number of results returned by the query. (read-only)

- indexOfResult:

Returns the index of a query result object in the receiver’s results array.

groupedResults

An array containing hierarchical groups of query results. (read-only)

NSMetadataQueryResultGroup

The NSMetadataQueryResultGroup class represents a collection of grouped attribute results returned by an NSMetadataQuery object.

- enumerateResultsUsingBlock:

Enumerates the current set of results using the given block.

- enumerateResultsWithOptions:usingBlock:

Enumerates the current set of results using the given options and block.

valueLists

A dictionary containing the value lists generated by the query.

NSMetadataQueryAttributeValueTuple

The NSMetadataQueryAttributeValueTuple class represents attribute-value tuples, which are objects that contain the attribute name and value of a metadata attribute.

- valueOfAttribute:forResultAtIndex:

Returns the value for the attribute name attrName at the index in the results specified by idx.

- enableUpdates

Enables updates to the query results.

- disableUpdates

Disables updates to the query results.

operationQueue

The queue on which query result notifications are posted.