Re: Stuck in basic bindings
Re: Stuck in basic bindings
- Subject: Re: Stuck in basic bindings
- From: Camillo Lugaresi <email@hidden>
- Date: Thu, 19 Jan 2006 01:11:23 +0100
On 18/gen/06, at 22:11, Francis Derive wrote:
- may be you wanted to say that mouseXlocation is not KVO-
compliant and I agree to this, after Miguel correctly mentioned
that - for the mouseXlocation dependent key to be computed, I had
not to declare it as an ivar - and its (KVC) accessors -, but only
to make mouseXlocation a method returning the dependent value -
dependent upon NSPoint mouseLocation.
But, then, I saw a problem because this mouseXlocation was
signaled to be "non KVO" compliant - and I understand it is not KVO
compliant not to even be KVC compliant - when I had bound it to ...
( could be a model class ivar, or directly to the NSTextField, as I
told I am confused and I have to restart from fresh with my mind ).
A key-value coded property is observable when observers are notified
before and after its value is changed.
You can do this by hand by calling willChangeValueForKey: before
changing the value and didChangeValueForKey: after changing it, or
you can use a KVC accessor to change the property, because by default
Cocoa automatically sends KVO notifications when a setter accessor is
called.
However, if you change a property without using an accessor and don't
bracket the change with will/didChangeValueForKey calls, then that
change will not be observable.
See Shawn's reply for code examples.
Camillo
_______________________________________________
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