FROM : Jens Alfke
DATE : Sat Mar 15 06:27:10 2008
On 14 Mar '08, at 6:20 PM, norio ota wrote:
> I set an action to a NSDatePicker and I'd like to know if an input
> value , especially year component, is different from the year of its
> previous date in the action method, without having a placeholder for
> the previous value.
Use key-value observing (KVO). You can configure it to tell you the
old as well as the new value.
It's all described in great detail in the documentation; read it
carefully, because it gets quite tricky, though. For just this one
case, it might be simpler just to store the previous value in an
instance variable...
—Jens
DATE : Sat Mar 15 06:27:10 2008
On 14 Mar '08, at 6:20 PM, norio ota wrote:
> I set an action to a NSDatePicker and I'd like to know if an input
> value , especially year component, is different from the year of its
> previous date in the action method, without having a placeholder for
> the previous value.
Use key-value observing (KVO). You can configure it to tell you the
old as well as the new value.
It's all described in great detail in the documentation; read it
carefully, because it gets quite tricky, though. For just this one
case, it might be simpler just to store the previous value in an
instance variable...
—Jens
| Related mails | Author | Date |
|---|---|---|
| norio ota | Mar 15, 02:20 | |
| Jens Alfke | Mar 15, 06:27 |






Cocoa mail archive

