• 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: Boggled By Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Boggled By Bindings


  • Subject: Re: Boggled By Bindings
  • From: Jacob Lukas <email@hidden>
  • Date: Thu, 30 Sep 2004 15:55:14 -0700


On Sep 30, 2004, at 1:32 PM, Patrick Machielse wrote:

I want to bind to a new ivar of my NSArrayController subclass, but somehow
the change notifications never get send.

I had the same problem recently. What I found that works is using:
[self addObserver:self forKeyPath:@"arrangedObjects" options:nil context:nil];
in awakeFromNib and
[self removeObserver:self forKeyPath:"];
in dealloc. Then implement:

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if (keyPath == ")
[self didChangeValueForKey:@"ivar"];
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}

I also had to override automaticallyNotifiesObserversForKey: exactly how you did.

Jacob
 _______________________________________________
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

  • Follow-Ups:
    • Re: Boggled By Bindings
      • From: Scott Stevenson <email@hidden>
References: 
 >Boggled By Bindings (From: Patrick Machielse <email@hidden>)

  • Prev by Date: Boggled By Bindings
  • Next by Date: Re: Newbie question: How do I keep animations going NSProgressIndicator...
  • Previous by thread: Boggled By Bindings
  • Next by thread: Re: Boggled By Bindings
  • Index(es):
    • Date
    • Thread