<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopUpButtonCell/indexOfItem(withTitle:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopUpButtonCell(im)indexOfItemWithTitle:"
  },
  "title" : "indexOfItem(withTitle:)"
}
-->

# indexOfItem(withTitle:)

Returns the index of the item with the specified title.

```
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

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

## See Also

[`indexOfSelectedItem`](/documentation/AppKit/NSPopUpButtonCell/indexOfSelectedItem)

The index of the item last selected by the user.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)