My mac app need to hide or disable the whole touchBar.
I have read the following official documents:
But, I do not know how to implement it with objc.
You have recreated a duplicate of the other post. You should better have transfered the post from CocoaTocuh to Cocoa.
I will reply in CocoaTouch where you have posted additional information.
Have a look here, if it can help: