---
title: "indexOfItem(withTitle:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspopupbuttoncell/indexofitem(withtitle:)"
---

# indexOfItem(withTitle:)

Returns the index of the item with the specified title.

## Declaration

```swift
func indexOfItem(withTitle title: String) -> Int
```

## Parameters

- `title`: The title of the item you want. You must not pass nil for this parameter.

## Return Value

Return Value The index of the item or -1 if no item with the specified title was found.

## See Also

### Related Documentation

- [indexOfSelectedItem](appkit/nspopupbuttoncell/indexofselecteditem.md)

### Accessing the items

- [itemArray](appkit/nspopupbuttoncell/itemarray.md)
- [numberOfItems](appkit/nspopupbuttoncell/numberofitems.md)
- [index(of:)](appkit/nspopupbuttoncell/index(of:).md)
- [indexOfItem(withTag:)](appkit/nspopupbuttoncell/indexofitem(withtag:).md)
- [indexOfItem(withRepresentedObject:)](appkit/nspopupbuttoncell/indexofitem(withrepresentedobject:).md)
- [indexOfItem(withTarget:andAction:)](appkit/nspopupbuttoncell/indexofitem(withtarget:andaction:).md)
- [item(at:)](appkit/nspopupbuttoncell/item(at:).md)
- [item(withTitle:)](appkit/nspopupbuttoncell/item(withtitle:).md)
- [lastItem](appkit/nspopupbuttoncell/lastitem.md)
