How would I get notified of a value of a NSDatePicker, when it's changed?
Asked
Active
Viewed 2,790 times
3 Answers
4
I've only done it on the iPhone with UIDatePicker but it is similar on the Mac, you register as a delegate and receive messages. See Apple's Docs here.
I should clarify, this tells you when it changed, you still need to call -dateValue
to get the date.

bmalicoat
- 2,508
- 3
- 24
- 23
4
The same you would any other control. Options are:
- Target/Action
- Binding
- Observe notification
- Delegate

Mike Abdullah
- 14,933
- 2
- 50
- 75
-
1AS of 2016, NSDatePicker doesn't seem to send an action or run KVO (although the problem with the latter may be a bug in my code) – JeremyP Apr 13 '16 at 07:26
1
You can bind the picker's value
binding to a property of your controller, or a property of a model object (through a controller).

Peter Hosey
- 95,783
- 15
- 211
- 370