Class

NSPointerFunctions

An instance of NSPointerFunctions defines callout functions appropriate for managing a pointer reference held somewhere else.

Declaration

@interface NSPointerFunctions : NSObject

Overview

The functions specified by an instance of NSPointerFunctions are separated into two clusters—those that define “personality” such as “object” or "C-string”, and those that describe memory management issues such as a memory deallocation function. There are constants for common personalities and memory manager selections (see Memory and Personality Options).

NSHashTable, NSMapTable, and NSPointerArray use an NSPointerFunctions object to define the acquisition and retention behavior for the pointers they manage. Note, however, that not all combinations of personality and memory management behavior are valid for these collections. The pointer collection objects copy the NSPointerFunctions object on input and output, so you cannot usefully subclass NSPointerFunctions.

Subclassing Notes

NSPointerFunctions is not suitable for subclassing.

Topics

Creating and Initializing an NSPointerFunctions Object

- initWithOptions:

Returns an NSPointerFunctions object initialized with the given options.

+ pointerFunctionsWithOptions:

Returns a new NSPointerFunctions object initialized with the given options.

Personality Functions

hashFunction

The hash function.

isEqualFunction

The function used to compare pointers.

sizeFunction

The function used to determine the size of pointers.

descriptionFunction

The function used to describe elements.

Memory Configuration

acquireFunction

The function used to acquire memory.

relinquishFunction

The function used to relinquish memory.

usesStrongWriteBarrier

Specifies whether, in a garbage collected environment, pointers should be assigned using a strong write barrier.

Deprecated
usesWeakReadAndWriteBarriers

Specifies whether, in a garbage collected environment, pointers should use weak read and write barriers.

Deprecated

Constants

NSPointerFunctionsOptions

Defines the memory and personality options for an NSPointerFunctions object.

Relationships

Inherits From

Conforms To

See Also

Getting the Pointer Functions

pointerFunctions

The functions in use by the receiver.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software