• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting changes in model (NSObjectController, bindings)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting changes in model (NSObjectController, bindings) (From: Christian Schneider <email@hidden>)
 >Re: Getting changes in model (NSObjectController, bindings) (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Adding an NSImageView to an NSView [Updated]
  • Next by Date: Re: Accessing undo stack?
  • Previous by thread: Re: Getting changes in model (NSObjectController, bindings)
  • Next by thread: Unable to delete controls in Interface Builder
  • Index(es):
    • Date
    • Thread