<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSOrderedSet/objects(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOrderedSet(im)objectsAtIndexes:"
  },
  "title" : "objects(at:)"
}
-->

# objects(at:)

Returns the objects in the ordered set at the specified indexes.

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

## Parameters

`indexes`

The indexes.

## Return Value

The returned objects are in the ascending order of their indexes in indexes, so that object in returned ordered set with higher index in indexes will follow the object with smaller index in indexes.

## Discussion

Raises an [`rangeException`](/documentation/Foundation/NSExceptionName/rangeException) if any location in indexes exceeds the bounds of the array, of if `indexes` is `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)