Adopted by: Various Cocoa classes
Declared in:
- Foundation/NSObject.h
The NSMutableCopying protocol declares a method for providing mutable copies of an object. Only classes that define an "immutable vs. mutable" distinction should adopt this protocol. Classes that don't define such a distinction should adopt NSCopying instead.
NSMutableCopying declares one method, mutableCopyWithZone:, but mutable copying is commonly invoked with the convenience method mutableCopy. The mutableCopy method is defined for all NSObjects and simply invokes mutableCopyWithZone: with the default zone.
See the NSCopying protocol for details on implementing copying behavior.
- mutableCopyWithZone:(NSZone
*)zone
NSDefaultMallocZone()
.
The returned object is implicitly retained by the sender, who is
responsible for releasing it. The copy returned is mutable whether
the original is mutable or not.
See Also: - copyWithZone: (NSCopying protocol), - mutableCopy (NSObject)