I would like to bind a boolean enabledproperty NSTextFieldto a state NSButton. I already tried adding a custom NSValueTransformerone that converts the state NSButtonto NSNumber. However, in this case, text fields are disabled for some reason. My second approach: the bad fails, as it NSValueTransformerdoes not offer return primitive types such as BOOL.
Example:
The screenshot shows an example in which text fields are disabled because the flag has a state NSOnState. I would also like to bind tags to this state.

In addition, it would be convenient if I could set the “disabled text” in Interface Builder . In the above example, I set the text in a related class.
Edit:
I set the self.anonymousLoginCheckbox.statemodel key path for the included property of the account text field. Similarly for the password text field. However, it does not work .

Update:
I created a project that is available on GitHub, demonstrating the implementation , kindly described by Nicholas Bachshmidt.
source
share