<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSPointerArray/insertPointer(_:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPointerArray(im)insertPointer:atIndex:"
  },
  "title" : "insertPointer(_:at:)"
}
-->

# insertPointer(_:at:)

Inserts a pointer at a given index.

```
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 [`count`](/documentation/Foundation/NSPointerArray/count) of the receiver.

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)