Re: NSTextField and bindings
Re: NSTextField and bindings
- Subject: Re: NSTextField and bindings
- From: Steve Sims <email@hidden>
- Date: Wed, 5 May 2004 12:08:02 -0400
On 5 May 2004, at 06:07, Allan Odgaard wrote:
So unless you get KVV to work, I'd suggest disabling the automatic
notification for the 'text' key (see
automaticallyNotifiesObserversForKey: in NSKeyValueObserving). As an
alternative you should also be able to send setText: using
performSelectorAfterDelay:withObject:, to get out of the current
"notification" -- although I have tested neither methods...
I received an off-list message that suggested using
performSelector:withObject:afterDelay: in my validation routine to send
notification of the change of value with will/didChangeValueForKey.
Sure enough it works a treat.
I tried using the delayed notify in my setText: routine, but for some
reason this didn't work. I'm not sure why, and since the only way
setText: ever gets called in my app is through the bindings mechanism
which also always calls the validation I'm not too fussed.
Of course to prevent double notifications I also wrote an
automaticallyNotifiesObserversForKey: call to cut out automatic
notification for my "text" key.
Thanks for the help!
Steve
_______________________________________________
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.