---
title: "insertPointer(_:at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nspointerarray/insertpointer(_:at:)"
---

# insertPointer(_:at:)

Inserts a pointer at a given index.

## Declaration

```swift
func insertPointer(_ item: UnsafeMutableRawPointer?, at index: Int)
```

## Parameters

- `item`: The pointer to add.
- `index`: The index of an element in the receiver. This value must be less than the doc://com.apple.foundation/documentation/Foundation/NSPointerArray/count of the receiver.

## Discussion

Discussion Elements at and above index, including NULL values, slide higher.

## See Also

### Managing the Collection

- [count](foundation/nspointerarray/count.md)
- [allObjects](foundation/nspointerarray/allobjects.md)
- [pointer(at:)](foundation/nspointerarray/pointer(at:).md)
- [addPointer(_:)](foundation/nspointerarray/addpointer(_:).md)
- [removePointer(at:)](foundation/nspointerarray/removepointer(at:).md)
- [replacePointer(at:withPointer:)](foundation/nspointerarray/replacepointer(at:withpointer:).md)
- [compact()](foundation/nspointerarray/compact().md)
