makeTouchBar(…) called on self.touchBar access

I have a typical touch bar application, where I would like to disable control after clicking on button. This is the sample demo on github.


I am passing `makeTouchBar` from window controller to my `ViewController`. Once the program started, touch bar is created. When I click the button I would like to obtain `NSTouchBarItem` by identifier, access the view(NSControl) and disable it. However, once I am accessing `self.touchBar` just for reading, framework is immediately calling again `makeTouchBar`. As a result, I'm not able to disable control.


Why framework is calling `makeTouchBar` once more, after it already created one during startup? Even if it really need to create again touchBar, why I am not able to hide control there? Do I understand right, that `NSTouchBar` instance returned by `makeTouchBar` is eventually assigned to responder's `touchBar` stored property?


My attempt to understand it to avoid accessing `self.touchBar` by creating reference to first touch bar instance. This is helping, but in documentation I can't find anything, which is restricting me to access self.touchBar property.