---
title: "mutableSetValue(forKey:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/mutablesetvalue(forkey:)"
---

# mutableSetValue(forKey:)

Returns a mutable set proxy that provides read-write access to the unordered to-many relationship specified by a given key.

## Declaration

```swift
func mutableSetValue(forKey key: String) -> NSMutableSet
```

## Parameters

- `key`: The name of an unordered to-many relationship.

## Return Value

Return Value A mutable set that provides read-write access to the unordered to-many relationship specified by key.

## Discussion

Discussion Objects added to the mutable set proxy become related to the receiver, and objects removed from the mutable set become unrelated. The default implementation recognizes the same simple accessor methods and set accessor methods as 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:) would return. The search pattern that mutableSetValueForKey: uses is described in Accessor Search Patterns in Key-Value Coding Programming Guide.

## See Also

### Getting Values

- [value(forKey:)](objectivec/nsobject-swift.class/value(forkey:).md)
- [value(forKeyPath:)](objectivec/nsobject-swift.class/value(forkeypath:).md)
- [dictionaryWithValues(forKeys:)](objectivec/nsobject-swift.class/dictionarywithvalues(forkeys:).md)
- [value(forUndefinedKey:)](objectivec/nsobject-swift.class/value(forundefinedkey:).md)
- [mutableArrayValue(forKey:)](objectivec/nsobject-swift.class/mutablearrayvalue(forkey:).md)
- [mutableArrayValue(forKeyPath:)](objectivec/nsobject-swift.class/mutablearrayvalue(forkeypath:).md)
- [mutableSetValue(forKeyPath:)](objectivec/nsobject-swift.class/mutablesetvalue(forkeypath:).md)
- [mutableOrderedSetValue(forKey:)](objectivec/nsobject-swift.class/mutableorderedsetvalue(forkey:).md)
- [mutableOrderedSetValue(forKeyPath:)](objectivec/nsobject-swift.class/mutableorderedsetvalue(forkeypath:).md)
