Contents

NSPointerArray

A collection similar to an array, but with a broader range of available memory semantics.

Declaration

class NSPointerArray

Overview

The pointer array class is modeled after NSArray, but can also hold nil values. You can insert or remove nil values which contribute to the array’s count.

A pointer array can be initialized to maintain strong or weak references to objects, or according to any of the memory or personality options defined by NSPointerFunctions.Options.

The NSCopying and NSCoding protocols are applicable only when a pointer array is initialized to maintain strong or weak references to objects.

When enumerating a pointer array with NSFastEnumeration using for...in, the loop will yield any nil values present in the array. See Fast Enumeration Makes It Easy to Enumerate a Collection in Programming with Objective-C for more information.

Subclassing Notes

NSPointerArray is not suitable for subclassing.

Topics

Creating and Initializing a New Pointer Array

Managing the Collection

Getting the Pointer Functions

Initializers

See Also

Pointer Collections