O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSCopying — Mac OS X 10.0

Synopsis

This protocol declares a single method for classes to implement: copyWithZone:. Classes should implement this method to create and return a fully functioning object that is a copy of the receiver. The zone parameter indicates what memory zone the new object should be allocated in; if this parameter is nil, then the instance is allocated in the default zone. Clients generally make copies of objects using NSObject’s copy method, which is a convenience method for invoking copyWithZone: with nil as the zone.

@protocol NSCopying
                                  // Instance Methods
   - (id)copyWithZone:(NSZone *)zone;
@end

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required