Contents

comboBoxCell(_:indexOfItemWithStringValue:)

Invoked by an NSComboBoxCell object to synchronize the pop-up list’s selected item with the text field’s contents.

Declaration

optional func comboBoxCell(_ comboBoxCell: NSComboBoxCell, indexOfItemWithStringValue string: String) -> Int

Parameters

  • comboBoxCell:

    The combo box cell.

  • string:

    The string to match. If Comboboxcell(_:completedstring:) is implemented, aString is the string returned by that method. Otherwise, aString is the text that the user has typed.

Return Value

The index for the pop-up list item matching aString, or NSNotFound if no item matches.

Discussion

If you don’t implement this method, the receiver does not synchronize the pop-up list’s selected item with the text field’s contents.

See Also

Instance Methods