• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: previous value of NSControl
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >previous value of NSControl (From: norio ota <email@hidden>)

  • Prev by Date: Re: newb problem- Currency Converter app problem- Can't Add ConverterController Class to Nib
  • Next by Date: ScriptingBridgeConcepts problem
  • Previous by thread: previous value of NSControl
  • Next by thread: ScriptingBridgeConcepts problem
  • Index(es):
    • Date
    • Thread