I don’t understand something from the RaiseMan application begun in Chapter 8: specifically, the bindings created on page 130-131 for the two buttons, “Add New Employee” and “Delete.”
For the Delete button, the following is written: “…in the Bindings Inspector, bind the button’s enabled binding to the canRemove attribute of the NSArrayController, as shown in Figure 8.11.”
What I don’t understand is why do we not do something similar, regarding the “enabled binding” for the “Add New Employee” button? I guess I don’t understand what the “enabled binding” is. Both buttons are enabled in the application, so I don’t think it can be referring to this fact. What, then, does “enabled” mean in this context? To look at my question another way, for the “Add New Employee” button, I only have to set the button’s action to the add: method. For the “Delete” button, however, in addition to setting the action, in this case to the remove: method, I also have to mess with the button’s “enabled binding” and bind it to the NSArrayController’s canRemove attribute.
I don’t understand what is being done, and what would not happen if I didn’t bind the button’s “enabled binding” to the NSArrayController’s canRemove attribute.