I am developing an app for Mac OSX and i need to perform a button click with code but i can't handle it.
Anybody knows how to do this ??
Just to remember i am coding to MAC.
THANKS
I am developing an app for Mac OSX and i need to perform a button click with code but i can't handle it.
Anybody knows how to do this ??
Just to remember i am coding to MAC.
THANKS
You almost answered your own question. Just call performClick: on the button. In Swift:
@IBOutlet weak var myButton: NSButton!
...
myButton.performClick(nil)And it will simulate the button being clicked from code. Of course your button needs to be wired up to your interface first for this to work.