---
title: "insert(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsarraycontroller/insert(_:)"
---

# insert(_:)

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

## Declaration

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

## Parameters

- `sender`: Typically the object that invoked this method.

## Discussion

Discussion If an entity name is specified (see 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. 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 (see Error Responders and Error Recovery) can provide feedback as a sheet.

## See Also

### Inserting

- [canInsert](appkit/nsarraycontroller/caninsert.md)
