• 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: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?


  • Subject: Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 5 Apr 2010 13:30:32 -0700

On Mon, Apr 5, 2010 at 3:08 AM, Jerry Krinock <email@hidden> wrote:
> I already use MAKVONotificationCenter in this project, but I don't see the need for it here.  In the array controller's -dealloc,
>
>    [self removeObserver:self
>              forKeyPath:@"selectedObjects"] ;
>
> Why is that perilous?  (It seems to work.)

Because if NSArrayController also self-observes on @"selectedObjects",
you've removed that observation from under its feet.

MAKVONotificationCenter and OFBinding solve this problem by creating
separate objects, so they'll only ever register for a keypath once.

--Kyle Sluder
_______________________________________________

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: 
 >Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey? (From: Jerry Krinock <email@hidden>)
 >Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey? (From: Kyle Sluder <email@hidden>)
 >Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Bindings & ivars
  • Next by Date: Re: UpdateSystemActivity replacement in Cocoa?
  • Previous by thread: Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?
  • Next by thread: iPhone CoreData TableView not updating
  • Index(es):
    • Date
    • Thread