• 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: NSTextField: Sending action to target on every keypress
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField: Sending action to target on every keypress


  • Subject: Re: NSTextField: Sending action to target on every keypress
  • From: Jim Correia <email@hidden>
  • Date: Wed, 7 Feb 2007 14:37:06 -0500

On Feb 7, 2007, at 2:24 PM, Mike R. Manzano wrote:

I want a validation routine to run for every character someone types into an NSTextField. The validation routine determines if an Okay button gets enabled. It is not good enough for me to wait until the text field loses focus, because that would require the user to click into another field or hit the tab key before the Okay button becomes clickable.

Are you using bindings, or target/action?

If the latter, you want to be the text field's delegate and react to - controlTextDidChange:.

<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSControl_Class/Reference/Reference.html#// apple_ref/occ/instm/NSObject/controlTextDidChange:>

Jim

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >NSTextField: Sending action to target on every keypress (From: "Mike R. Manzano" <email@hidden>)

  • Prev by Date: NSTextField: Sending action to target on every keypress
  • Next by Date: Re: Execute code when exiting textfield
  • Previous by thread: NSTextField: Sending action to target on every keypress
  • Next by thread: Showing more than one entity in a tableview (Core Data)
  • Index(es):
    • Date
    • Thread