I have a clear button in an application for Mac OS.When the button is pressed, it clears all the values of the form and resets NSPopUpButtonto the first element.
NSPopUpButton
The question is how to change the control NSPopUpButtonwith code.
thank
You may call:
Goal C:
[myPopupButton selectItemAtIndex:0]
Swift:
myPopupButton.selectItem(at: 0)
See here for more details .
When the argument is 0, it means nil , and it works. If you put another number (e.g. 2), this will not work, because the argument is not a number !!!