---
title: "indexOfItem(withObjectValue:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscombobox/indexofitem(withobjectvalue:)"
---

# indexOfItem(withObjectValue:)

Searches the receiver’s internal item list for the specified object and returns the lowest matching index.

## Declaration

```swift
func indexOfItem(withObjectValue object: Any) -> Int
```

## Parameters

- `object`: The object for which to return the index.

## Return Value

Return Value The lowest index in the internal item list whose corresponding value is equal to that of the specified object. Objects are considered equal if they have the same id or if isEqual: returns true.

## Discussion

Discussion If none of the objects in the receiver’s internal item list are equal to anObject, indexOfItem(withObjectValue:) returns NSNotFound. Discussion This method logs a warning if the usesDataSource property is true.

## See Also

### Related Documentation

- [selectItem(withObjectValue:)](appkit/nscombobox/selectitem(withobjectvalue:).md)

### Manipulating the Displayed List

- [itemObjectValue(at:)](appkit/nscombobox/itemobjectvalue(at:).md)
- [noteNumberOfItemsChanged()](appkit/nscombobox/notenumberofitemschanged().md)
- [reloadData()](appkit/nscombobox/reloaddata().md)
- [scrollItemAtIndexToTop(_:)](appkit/nscombobox/scrollitematindextotop(_:).md)
- [scrollItemAtIndexToVisible(_:)](appkit/nscombobox/scrollitematindextovisible(_:).md)
