<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSArrayController/insert(_:atArrangedObjectIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSArrayController(im)insertObject:atArrangedObjectIndex:"
  },
  "title" : "insert(_:atArrangedObjectIndex:)"
}
-->

# insert(_:atArrangedObjectIndex:)

Inserts `object` into the receiver’s arranged objects array at the location specified by `index`, and adds it to the receiver’s content collection.

```
func insert(_ object: Any, atArrangedObjectIndex index: Int)
```

## Discussion

Subclasses can override this method to provide customized arranged objects support. An error is returned if the given index is outside of the [`arrangedObjects`](/documentation/AppKit/NSArrayController/arrangedObjects) range, or if the given object would not appear in the arrangedObjects. Set the [`clearsFilterPredicateOnInsertion`](/documentation/AppKit/NSArrayController/clearsFilterPredicateOnInsertion) to <doc://com.apple.documentation/documentation/Swift/true> to allow insertion.

---

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)