<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.4.0 -",
    "macOS: 10.15.4 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRasterizationRateSampleArray/setObject:atIndexedSubscript:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLRasterizationRateSampleArray(im)setObject:atIndexedSubscript:"
  },
  "title" : "setObject:atIndexedSubscript:"
}
-->

# setObject:atIndexedSubscript:

Stores a sample value at the specified index.

```
- (void) setObject:(NSNumber *) value atIndexedSubscript:(NSUInteger) index;
```

## Parameters

`value`

The new value to set.

`index`

The index of the element you want to set.

## Discussion

The method converts the value to a single precision floating-point value. If the index you specified is out of bounds, this method does nothing.

---

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)