NSToolbar: how do I initialize the selected item?

I have a Mac OS application with a settings window with NSToolbar on it.

I also have a subtitle under it and other 3 user views that load inside the first one when the user clicks on one of the parameters.

So far so good. Now I realized that the first item is not selected by default when the window loads.

I do not see any options for inspectors other than the β€œselectable” ones that I used. But there is no "selected." Should I do this programmatically? How?

+4
source share
1 answer

NSToolbar has a -setSelectedItemIdentifier: method, which you can use in your -windowDidLoad method.

+10
source

All Articles