mutableSetValueForKey:

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

Declaration

- (NSMutableSet *)mutableSetValueForKey:(NSString *)key

Parameters

key

The name of one of the receiver's to-many relationships.

Overview

If key is not a property defined by the model, the method raises an exception.

This method is overridden by NSManagedObject to access the managed object’s generic dictionary storage unless the receiver’s class explicitly provides key-value coding compliant accessor methods for key.

Special Considerations

For performance reasons, the proxy object returned by managed objects for mutableSetValueForKey: does not support set<Key>: style setters for relationships. For example, if you have a to-many relationship employees of a Department class and implement accessor methods employees and setEmployees:, then manipulate the relationship using the proxy object returned by mutableSetValueForKey:@"employees", setEmployees: is not invoked. You should implement the other mutable proxy accessor overrides instead (see Managed Object Accessor Methods in Core Data Programming Guide).

See Also

Supporting Key-Value Coding

- valueForKey:

Returns the value for the property specified by key.

- setValue:forKey:

Sets the specified property of the managed object to the specified value.

- primitiveValueForKey:

Returns the value for the specified property from the managed object’s private internal storage .

- setPrimitiveValue:forKey:

Sets the value of a given property in the managed object's private internal storage.

- objectIDsForRelationshipNamed:

Returns the object IDs for all of the managed objects that are in the named relationship.