Protocol: NSMetadataQueryDelegate

Overview

The NSMetadataQueryDelegate protocol defines the optional methods implemented by delegates of NSMetadataQuery objects.Implemented by the delegate to return a different object for a specific query result object.Implemented by the delegate to return a different value for a specific attribute.

Instance Method Summary (collapse)

Instance Method Details

- (Object) metadataQuery(query, replacementObjectForResultObject:result)

Implemented by the delegate to return a different object for a specific query result object. By default query result objects are instances of the NSMetadataItem class. By implementing this method, you can return an object of a different class type for the specified result object.

Parameters:

  • query (NSMetadataQuery)

    The query that produced the result object to replace.

  • result (NSMetadataItem)

    The query result object to replace.

Returns:

  • (Object)

    Object that replaces the query result object.

- (Object) metadataQuery(query, replacementValueForAttribute:attribute, value:attributeValue)

Implemented by the delegate to return a different value for a specific attribute. The delegate implementation of this method could convert specific query attribute values to other attribute values, for example, converting date object values to formatted strings for display.

Parameters:

  • query (NSMetadataQuery)

    The query that produced the result object with attribute.

  • attribute (String)

    The attribute in question.

  • attributeValue (Object)

    The attribute value to replace.

Returns:

  • (Object)

    Object that replaces the value of attribute in the result object