iOS Developer Library

Developer

Foundation Framework Reference NSMetadataQueryResultGroup Class Reference

Options
Deployment Target:

On This Page
Language:

NSMetadataQueryResultGroup

Inheritance


Conforms To


Import Statement


Swift

import Foundation

Objective-C

@import Foundation;

Availability


Available in iOS 5.0 and later.

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

  • attribute attribute Property

    The result group’s attribute name. (read-only)

    Declaration

    Swift

    var attribute: String { get }

    Objective-C

    @property(readonly, copy) NSString *attribute

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in iOS 5.0 and later.

  • value value Property

    The result group’s value. (read-only)

    Declaration

    Swift

    var value: AnyObject { get }

    Objective-C

    @property(readonly, retain) id value

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in iOS 5.0 and later.

  • results results Property

    An array containing the result group’s result objects. (read-only)

    Declaration

    Swift

    var results: [AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSArray *results

    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 property and the resultAtIndex: method.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in iOS 5.0 and later.

  • The number of results returned by the result group. (read-only)

    Declaration

    Swift

    var resultCount: Int { get }

    Objective-C

    @property(readonly) NSUInteger resultCount

    Discussion

    For performance reasons, you should use this property rather than checking the count property on results.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in iOS 5.0 and later.

  • Returns the query result at a specific index.

    Declaration

    Swift

    func resultAtIndex(_ index: Int) -> AnyObject!

    Objective-C

    - (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 contained in results.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in iOS 5.0 and later.

  • subgroups subgroups Property

    An array containing the result group’s subgroups. (read-only)

    Declaration

    Swift

    var subgroups: [AnyObject]? { get }

    Objective-C

    @property(readonly, copy) NSArray *subgroups

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in iOS 5.0 and later.