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

# synchronizeTitleAndSelectedItem()

Ensures that the item being displayed by the receiver agrees with the selected item.

```
func synchronizeTitleAndSelectedItem()
```

## Discussion

If there’s no selected item, this method selects the first item in the item menu and sets the receiver’s item to match. For pull-down menus, this method makes sure that the first item is being displayed (the `NSPopUpButtonCell` object must be set to use the selected menu item, which happens by default).

## See Also

[`var indexOfSelectedItem: Int`](/documentation/AppKit/NSPopUpButton/indexOfSelectedItem)

The index of the item that was last selected by the user.

[`var itemArray: [NSMenuItem]`](/documentation/AppKit/NSPopUpButton/itemArray)

The array of menu item objects associated with the button.



---

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)