Re: updating NSTextField with key validation?
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