Returns an array containing the objects in the array at the indexes specified by a given index set.
SDKs
- iOS 2.0+
- macOS 10.4+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (NSArray<Object Type> *)objectsAtIndexes:(NSIndex Set *)indexes;
Return Value
An array containing the objects in the array at the indexes specified by indexes
.
Discussion
The returned objects are in the ascending order of their indexes in indexes
, so that object in returned array with higher index in indexes will follow the object with smaller index in indexes
.
Raises an NSRange
if any location in indexes
exceeds the bounds of the array, indexes
is nil
.