An instance of NSPointerFunctions defines callout functions appropriate for managing a pointer reference held somewhere else.
Language
- Swift
- Objective-C
SDKs
- iOS 6.0+
- macOS 10.5+
- tvOS 6.0+
- watchOS 2.0+
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.