Re: Getting changes in model (NSObjectController, bindings)
Re: Getting changes in model (NSObjectController, bindings)
- Subject: Re: Getting changes in model (NSObjectController, bindings)
- From: Christian Schneider <email@hidden>
- Date: Thu, 7 Apr 2005 09:30:02 +0200
Jonathon,
thanks for your answer but that's not what I meant.
I want the object implementing -clip and -setClip: to be notified when
its model object was changed in the UI not vice versa.
chris
On Apr 6, 2005 5:02 PM, Jonathon Mah <email@hidden> wrote:
> 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.
>
>
_______________________________________________
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