• 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 trigger method on key-press?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField trigger method on key-press?


  • Subject: Re: NSTextField trigger method on key-press?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 28 Aug 2002 18:28:15 -0700

On Wednesday, August 28, 2002, at 06:08 PM, Matt Gemmell wrote:

I have an NSTextField, which triggers a certain method when the user presses return/enter. However, I'd like to trigger the method whenever they press any key (when they edit the contents of the field).

Is there a nicer way to do this than using an NSTimer to poll the contents of the field periodically?

Yes--listen to the NSControlTextDidChangeNotification, or implement the controlTextDidChange: delegate method. However, depending on what you wish to do, you may be better off using a formatter.

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSTextField trigger method on key-press? (From: Matt Gemmell <email@hidden>)

  • Prev by Date: Re: NSTextField trigger method on key-press?
  • Next by Date: Strange problem
  • Previous by thread: Re: NSTextField trigger method on key-press?
  • Next by thread: Strange problem
  • Index(es):
    • Date
    • Thread