NSMetadataQueryResultGroup Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in OS X v10.4 and later.
Companion guide
Declared in
NSMetadata.h

Overview

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

Tasks

Getting Query Results

Instance Methods

attribute

Returns the attribute name for the receiver’s result group.

- (NSString *)attribute
Return Value

The attribute name for the receiver’s result group.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSMetadata.h

resultAtIndex:

Returns the query result at a specific index.

- (id)resultAtIndex:(NSUInteger)index
Parameters
index

The index of the desired result.

Return Value

The query result at a specific index.

Discussion

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

Availability
  • Available in OS X v10.4 and later.
Declared In
NSMetadata.h

resultCount

Returns the number of results returned by the receiver.

- (NSUInteger)resultCount
Return Value

The number of results returned by the receiver.

Discussion

For performance reasons, you should use this method, rather than invoking count on results.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSMetadata.h

results

Returns an array containing the result objects for the receiver.

- (NSArray *)results
Return Value

An array containing the result objects for the receiver.

Discussion

The results array is a proxy object that is primarily intended for use with Cocoa bindings. While it is possible to copy the proxy array to get a “snapshot” of the complete current query results, it is generally not recommended due to performance and memory issues. To access individual result array elements you should instead use the resultCount and resultAtIndex: methods.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSMetadata.h

subgroups

Returns an array containing the subgroups of the receiver.

- (NSArray *)subgroups
Return Value

An array containing the subgroups of the receiver.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSMetadata.h

value

Returns the value of the attribute name for the receiver.

- (id)value
Return Value

The value of the attribute name for the receiver.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSMetadata.h