Re: Is KVO disabled during observeValueForKeyPath?
Re: Is KVO disabled during observeValueForKeyPath?
- Subject: Re: Is KVO disabled during observeValueForKeyPath?
- From: Ondra Cada <email@hidden>
- Date: Sun, 9 Apr 2006 21:05:20 +0200
Larry,
On 9.4.2006, at 20:14, Larry Gerndt wrote:
I found an excellent solution to this: instead of changing the
value from within observeValueForKeyPath, I instead implement
validateValueForKeyPath and change the value there and return YES.
This is how I should have implemented it in the first place, and it
works well, but I'm just curious as to whether the above caveat is
indeed a known behavior.
Yup. IIRC, the documentation explicitly warns you not to validate
values in setters (which, effectively, you did in the original code).
And the solution's right to point: that's exactly what validators are
for :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden