---
title: "indexOfItem(withTitle:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspopupbutton/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.

## Return Value

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

## See Also

### Getting the indices of menu items

- [index(of:)](appkit/nspopupbutton/index(of:).md)
- [indexOfItem(withTag:)](appkit/nspopupbutton/indexofitem(withtag:).md)
- [indexOfItem(withRepresentedObject:)](appkit/nspopupbutton/indexofitem(withrepresentedobject:).md)
- [indexOfItem(withTarget:andAction:)](appkit/nspopupbutton/indexofitem(withtarget:andaction:).md)
