<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/didChange(_:valuesAt:forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)didChange:valuesAtIndexes:forKey:"
  },
  "title" : "didChange(_:valuesAt:forKey:)"
}
-->

# didChange(_:valuesAt:forKey:)

Informs the observed object that the specified change has occurred on the indexes for a specified ordered to-many relationship.

```
func didChange(_ changeKind: NSKeyValueChange, valuesAt indexes: IndexSet, forKey key: String)
```

## Parameters

`changeKind`

The type of change that was made.

`indexes`

The indexes of the to-many relationship that were affected by the change.

`key`

The name of a property that is an ordered to-many relationship.

## Discussion

Use this method when implementing key-value-observing compliance manually.

### Special Considerations

You rarely need to override this method in subclasses, but if you do, be sure to call `super`. Calls to this method are always paired with a matching call to [`willChange(_:valuesAt:forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/willChange(_:valuesAt:forKey:)).

---

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)