Contents

subscript(_:)

Returns the object located at the specified index.

Declaration

subscript(idx: Int) -> ObjectType { get }

Parameters

  • idx:

    An index within the bounds of the fetch result.

Return Value

The object located at index in the fetch result.

Discussion

Raises a range exception if idx is beyond the end of the fetch result (that is, greater than or equal to the value of the count property).

This method behaves identically to the object(at:) method and allows you to access a fetch result using subscript syntax. That is, the two statements below produce the same result.

See Also

Querying a Fetch Result