Instance Method

setTitleWithMnemonic:

Sets the title the button displays when it’s in its normal state to the given string with an embedded mnemonic.

Declaration

- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;

Parameters

aString

The string to set as the button's title, taking into account the fact that an embedded “&” character is not a literal but instead marks the alternate state’s “keyboard mnemonic.” This title is always shown on buttons that don’t use their alternate contents when highlighting or displaying their alternate state.

Discussion

If necessary, setTitleWithMnemonic: redraws the button cell. Mnemonics are not supported in macOS.

See Also

Setting Titles

- alternateMnemonic

Returns the character in the alternate title that’s marked as the “keyboard mnemonic.”

Deprecated
- alternateMnemonicLocation

Returns an unsigned integer indicating the character in the alternate title that’s marked as the “keyboard mnemonic.”

Deprecated
alternateTitle

The string displayed by the button when it’s in its alternate state.

attributedAlternateTitle

The title displayed by the button when it’s in its alternate state, as an attributed string.

attributedTitle

The title displayed by the button when it’s in its normal state as an attributed string.

- setAlternateMnemonicLocation:

Sets the character in the alternate title that should be the “keyboard mnemonic.”

Deprecated
- setAlternateTitleWithMnemonic:

Sets the title the button displays when it’s in its alternate state to the given string with an embedded mnemonic.

Deprecated
- setFont:

Sets the font used to display the button's title and alternate title.

title

The title displayed on the button when it’s in its normal state.