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

# mutableArrayValue(forKey:)

Returns a mutable array proxy that provides read-write access to an ordered to-many relationship specified by a given key.

```
func mutableArrayValue(forKey key: String) -> NSMutableArray
```

## Parameters

`key`

The name of an ordered to-many relationship.

## Return Value

A mutable array proxy that provides read-write access to the ordered to-many relationship specified by `key`.

## Discussion

Objects added to the mutable array become related to the receiver, and objects removed from the mutable array become unrelated. The default implementation recognizes the same simple accessor methods and array accessor methods as [`value(forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/value(forKey:)), and follows the same direct instance variable access policies, but always returns a mutable collection proxy object instead of the immutable collection that [`value(forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/value(forKey:)) would return.

The search pattern that `mutableArrayValueForKey:` uses is described in [Accessor Search Patterns](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyValueCoding/SearchImplementation.html#//apple_ref/doc/uid/20000955) in [Key-Value Coding Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyValueCoding/index.html#//apple_ref/doc/uid/10000107i).

---

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)