• 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: Propagation of KVO through bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Propagation of KVO through bindings


  • Subject: Re: Propagation of KVO through bindings
  • From: "Hamish Allan" <email@hidden>
  • Date: Thu, 17 Apr 2008 10:32:25 +0200

On Wed, Apr 16, 2008 at 4:49 PM, Hamish Allan <email@hidden> wrote:

>  [myArrayController addObserver:self forKeyPath:@"arrangedObjects"
>         options:(NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew)
>  context:nil];
>  myDictionary = [[NSMutableDictionary alloc] init];
>  [myDictionary bind:@"boundArrangedObjects" toObject:myArrayController
>         withKeyPath:@"arrangedObjects" options:nil];
>  [myDictionary addObserver:self forKeyPath:@"boundArrangedObjects"
>         options:(NSKeyValueObservingOptionOld|NSKeyValueObservingOptionNew)
>  context:nil];

>  [...]
>  KVO is not informing me of the change through the binding.

For anyone reading the archives, I have done some more digging and
found out what the problem is. It appears that NSArrayController does
not send proper KVO notifications for arrangedObjects -- whatever the
change, it reports the old and new values to be nil, which causes the
default implementation of bind:toObject:withKeyPath:options: to drop
the notification rather than forward it (as the old and new values are
equal). I would encourage anyone who uses NSArrayController to file a
bug (mine is rdar://problem/5870167).

Best wishes,
Hamish
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Propagation of KVO through bindings (From: "Hamish Allan" <email@hidden>)

  • Prev by Date: Re: Implicit animation duration
  • Next by Date: Re: WebKit+AppleScript+JavaScript
  • Previous by thread: Propagation of KVO through bindings
  • Next by thread: NSString and utf16
  • Index(es):
    • Date
    • Thread