Contents

NSShouldRetainWithZone

Indicates whether an object should be retained.

Declaration

extern BOOL NSShouldRetainWithZone(id anObject, NSZone *requestedZone);

Parameters

  • anObject:

    An object.

  • requestedZone:

    A memory zone.

Return Value

Returns true if requestedZone is NULL, the default zone, or the zone in which anObject was allocated; otherwise false.

Discussion

This function is typically called from inside an NSObject’s copyWithZone:, when deciding whether to retain anObject as opposed to making a copy of it.

Special Considerations

This function is deprecated and unavailable for use with ARC.

See Also

Object Allocation and Deallocation