Protocol: NSCopying
Overview
The NSCopying protocol declares a method for providing functional copies of an object. The exact meaning of “copy” can vary from class to class, but a copy must be a functionally independent object with values identical to the original at the time the copy was made. A copy produced with NSCopying is implicitly retained by the sender, who is responsible for releasing it.Returns a new instance that’s a copy of the receiver. (required)
Instance Method Summary (collapse)
-
- copyWithZone:
Returns a new instance that’s a copy of the receiver.
Instance Method Details
- (Object) copyWithZone(zone)
Returns a new instance that’s a copy of the receiver. (required) The returned object is implicitly retained by the sender, who is responsible for releasing it. The copy returned is immutable if the consideration “immutable vs. mutable” applies to the receiving object; otherwise the exact nature of the copy is determined by the class.