---
title: "insertItem(withObjectValue:at:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscombobox/insertitem(withobjectvalue:at:)"
---

# insertItem(withObjectValue:at:)

Inserts an object at the specified location in the receiver’s internal item list.

## Declaration

```swift
func insertItem(withObjectValue object: Any, at index: Int)
```

## Parameters

- `object`: The object to add to the internal item list.
- `index`: The index in the list at which to add the new object. The previous item at index—along with all following items—is shifted down one slot to make room

## Discussion

Discussion This method logs a warning if the usesDataSource property is true.

## See Also

### Configuring the Combo Box Items

- [addItems(withObjectValues:)](appkit/nscombobox/additems(withobjectvalues:).md)
- [addItem(withObjectValue:)](appkit/nscombobox/additem(withobjectvalue:).md)
- [objectValues](appkit/nscombobox/objectvalues.md)
- [removeAllItems()](appkit/nscombobox/removeallitems().md)
- [removeItem(at:)](appkit/nscombobox/removeitem(at:).md)
- [removeItem(withObjectValue:)](appkit/nscombobox/removeitem(withobjectvalue:).md)
- [numberOfItems](appkit/nscombobox/numberofitems.md)
