Instance Method

objectsAtIndexes:

Returns an array containing the objects in the fetch result at the indexes in the specified index set.

Declaration

- (NSArray<ObjectType> *)objectsAtIndexes:(NSIndexSet *)indexes;

Parameters

indexes

An index set containing indexes within the bounds of the fetch result.

Return Value

An array containing the objects in the fetch result at the indexes specified by indexes.

Discussion

The ordering of the returned array follows the index set. That is, in the returned array, an object with a higher index in the index set comes after any object with a smaller index in the index set.

Raises an exception (NSRangeException) if any index in the index set is beyond the end of the fetch result (that is, greater than or equal to the value of the count property).

See Also

Querying a Fetch Result

- containsObject:

Returns whether the specified object is present in the fetch result.

count

The number of objects in the fetch result.

- countOfAssetsWithMediaType:

Returns the number of assets in the fetch result of a specified type.

firstObject

The first object in the fetch result.

lastObject

The last object in the fetch result.

- objectAtIndex:

Returns the object located at the specified index.

- objectAtIndexedSubscript:

Returns the object located at the specified index.