I’m using the latest XCode 6.4, with Swift 1.2.
I’m trying to programmatically select a NSToolbarItem in my NSToolbar. I’ve searched a lot on the internet and there should be method for the NSToolbar called setSelectedItemIdentifier, but that method doesn’t exist (anymore?).
Is there another way to accomplish this?
Perhaps something like:
NSApplication.sharedApplication().sendAction(Selector("click"), to: myNSToolbarItem, from: sender)
But I don’t know what I should use instead of “click”.
Thanks in advance!
Update after Neo’s reply:
I want the toolbaritem to become visually “selected”, which changes its colour. I know how to call the func, but that won’t change the “selected”-state of the toolbaritem. So, if I could simulate a mouse click on the nstoolbaritem, that would solve my problem I guess (or a replacement of NSToolbar.setSelectedItemIdentifier).