---
title: "objects(at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsarray/objects(at:)"
---

# objects(at:)

Returns an array containing the objects in the array at the indexes specified by a given index set.

## Declaration

```swift
func objects(at indexes: IndexSet) -> [Any]
```

## Return Value

Return Value An array containing the objects in the array at the indexes specified by indexes.

## Discussion

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 rangeException if any location in indexes exceeds the bounds of the array, indexes is nil.

## See Also

### Querying an Array

- [contains(_:)](foundation/nsarray/contains(_:).md)
- [count](foundation/nsarray/count.md)
- [firstObject](foundation/nsarray/firstobject.md)
- [lastObject](foundation/nsarray/lastobject.md)
- [object(at:)](foundation/nsarray/object(at:).md)
- [subscript(_:)](foundation/nsarray/subscript(_:).md)
- [objectEnumerator()](foundation/nsarray/objectenumerator().md)
- [reverseObjectEnumerator()](foundation/nsarray/reverseobjectenumerator().md)
