---
title: NSPointerFunctions
framework: foundation
role: symbol
role_heading: Class
path: foundation/nspointerfunctions
---

# NSPointerFunctions

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

## Declaration

```swift
class NSPointerFunctions
```

## Overview

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

- [init(options:)](foundation/nspointerfunctions/init(options:).md)

### Personality Functions

- [hashFunction](foundation/nspointerfunctions/hashfunction.md)
- [isEqualFunction](foundation/nspointerfunctions/isequalfunction.md)
- [sizeFunction](foundation/nspointerfunctions/sizefunction.md)
- [descriptionFunction](foundation/nspointerfunctions/descriptionfunction.md)

### Memory Configuration

- [acquireFunction](foundation/nspointerfunctions/acquirefunction.md)
- [relinquishFunction](foundation/nspointerfunctions/relinquishfunction.md)
- [usesStrongWriteBarrier](foundation/nspointerfunctions/usesstrongwritebarrier.md)
- [usesWeakReadAndWriteBarriers](foundation/nspointerfunctions/usesweakreadandwritebarriers.md)

### Constants

- [NSPointerFunctions.Options](foundation/nspointerfunctions/options.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Accessing Pointer Functions

- [pointerFunctions](foundation/nshashtable/pointerfunctions.md)
