Why does NSToolbarItem get disabled automatically?
问题 I have a bit of an issue with buttons in the toolbar of my slideshow application for Mac. I want those buttons to be disabled when there is no active slideshow and enabled when there is an active slideshow. In order to achieve this, I set the buttons' isEnabled property to false at the start (I have tried both Interface Builder and my window's windowDidLoad ) and then in the didSet of my slideshow variable I do the following: var slideshow: Slideshow? { didSet { self.playPauseButton.isEnabled