Function

NSCopyObject

Creates an exact copy of an object.

Declaration

id NSCopyObject(id object, NSUInteger extraBytes, NSZone *zone);

Parameters

object

The object to copy.

extraBytes

The number of extra bytes required for indexed instance variables (this value is typically 0).

zone

The zone in which to create the new instance (pass NULL to specify the default zone).

Return Value

A new object that’s an exact copy of anObject, or nil if object is nil or if object could not be copied.

Discussion

This function is deprecated and unavailable for use with ARC. To create a copy of an object, use the copyWithZone: method instead.

See Also

Object Allocation and Deallocation

NSAllocateObject

Creates and returns a new instance of a given class.

NSDeallocateObject

Destroys an existing object.

NSDecrementExtraRefCountWasZero

Decrements the specified object’s reference count.

NSExtraRefCount

Returns the specified object’s reference count.

NSIncrementExtraRefCount

Increments the specified object’s reference count.

NSShouldRetainWithZone

Indicates whether an object should be retained.