I'm writing this from my iPhone so method names may be off, but it
might be worth trying willChangeValueForKey and didChangeValueForKey
from your validation code if you need to update the text field's value
without changing focus.

Also, if I recall correctly, the docs state that you should never use
resignFirstResponder directly. I know it's a temporary solution, but
you should be aware of it.

On Wednesday, April 15, 2009, David Scheidt <[email protected]> wrote:
>
> 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 protected])
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/s%40sidneysm.com
>
> This email sent to [email protected]
>
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to