Re: Getting changes in model (NSObjectController, bindings)
Re: Getting changes in model (NSObjectController, bindings)
- Subject: Re: Getting changes in model (NSObjectController, bindings)
- From: Jonathon Mah <email@hidden>
- Date: Thu, 7 Apr 2005 00:32:11 +0930
On 6 Apr 2005, at 23:51, Christian Schneider wrote:
But what I really want to know is, how can my controller (the class
with -clip and -setClip:) be notified that its object has changed? Do
I have to bind to its various changeable instance variables via KVO?
When you are modifying your object, you need to tell KVO that it
changed. If you change it by using setClip: then KVO will handle it for
you. Otherwise you need to wrap the code that changes clip with:
[self willChangeValueForKey:@"clip"];
cilp = someNewStuffHere;
[self didChangeValueForKey:@"clip"];
Ideally though, you want to change it only through accessor methods,
which will handle the notification stuff automatically.
Jonathon Mah
email@hidden
_______________________________________________
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