Re: previous value of NSControl
Re: previous value of NSControl
- Subject: Re: previous value of NSControl
- From: Jens Alfke <email@hidden>
- Date: Fri, 14 Mar 2008 22:27:10 -0700
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden