• 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: updating NSTextField with key validation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: updating NSTextField with key validation?


  • Subject: Re: updating NSTextField with key validation?
  • From: David Scheidt <email@hidden>
  • Date: Wed, 15 Apr 2009 13:41:34 -0400


On Apr 14, 2009, at 12:02 PM, David Scheidt wrote:


On Apr 14, 2009, at 11:54 AM, Kyle Sluder wrote:

You want to make the text field "continuous". Be aware that this will
also cause your changes to be committed, not just validated,
continuously.

Do you mean the checkbox in IB labelled "continuously updates value"? That's checked, and my validation methods are called after each keystroke. It's just that the UI isn't updated until the textfield is no longer the first responder._______________________________________________

So. I implemented a delegate with a controlTextDidChange: (NSNotification *)aNotification
method. This gets called after each keystroke, as I'd expect. If I do


	NSTextField * myObject = [aNotification object];
	[myObject resignFirstResponder];
	[myObject becomeFirstResponder];

in the delegate method, the coerced string in the TextField is displayed properly. Of course, I'm *sure* this is the Wrong Way To Do Things, if only because when the TextField becomes firstResponder again, it selects all the text in the text, and it gets deleted when you type the next character. I'm clearly missing something here. Anybody know what that might be? _______________________________________________

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


  • Follow-Ups:
    • Re: updating NSTextField with key validation?
      • From: Sidney San Martín <email@hidden>
References: 
 >updating NSTextField with key validation? (From: David Scheidt <email@hidden>)
 >Re: updating NSTextField with key validation? (From: Kyle Sluder <email@hidden>)
 >Re: updating NSTextField with key validation? (From: David Scheidt <email@hidden>)

  • Prev by Date: Re: stopping an application
  • Next by Date: Re: stopping an application
  • Previous by thread: Re: updating NSTextField with key validation?
  • Next by thread: Re: updating NSTextField with key validation?
  • Index(es):
    • Date
    • Thread