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

# insert(_:)

Creates a new object and inserts it into the receiver’s content array.

```
@IBAction func insert(_ sender: Any?)
```

## Parameters

`sender`

Typically the object that invoked this method.

## Discussion

If an entity name is specified (see [`entityName`](/documentation/AppKit/NSObjectController/entityName)), this method creates an instance of the of the class specified by the entity, otherwise this method creates an instance of the class specified by  [`objectClass`](/documentation/AppKit/NSObjectController/objectClass).

### Special Considerations

Beginning with OS X v10.4 the result of this method is deferred until the next iteration of the runloop so that the error presentation mechanism can provide feedback as a sheet.

---

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)