I am trying to enable and disable a datepicker with a checkbox, but I can not. What's wrong?
if ([checkBox state]==NSOnState) {
[datePicker isEnabled];
}
The -isEnabled
method is asking if the date picker is enabled. It doesn't change anything. You use -setEnabled:
to change the state. For example:
[datePicker setEnabled:([checkBox state]==NSOnState)];