• 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
WORKAROUND: observing changes in an NSArrayController's selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WORKAROUND: observing changes in an NSArrayController's selection


  • Subject: WORKAROUND: observing changes in an NSArrayController's selection
  • From: Chuck Musser <email@hidden>
  • Date: Sat, 31 Jul 2004 12:54:42 -0700

I ended up simply querying the array controller for the desired key directly, like this:

[myArrayController valueForKeyPath:@"selection.myKey"];

My earlier mail was not quite correct. The following message expression is what always returns NSNull:

[change valueForKey:NSKeyValueChangeNewKey];

Never did figure out why this is.

Chuck

Chuck Musser wrote:

When I use KVO to observe my NSArrayController's selection, my observeValueForKeyPath: ofObject: change: context: method gets called, but the contents of the "change" parameter are not what I expect. This dictionary contains "kind" and "new" keys, but the value associated with the "new" key is always NSNull.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >observing changes in an NSArrayController's selection (From: Chuck Musser <email@hidden>)

  • Prev by Date: WORKAROUND: Bound popup's current selection
  • Next by Date: Re: cocoa app from scratch
  • Previous by thread: observing changes in an NSArrayController's selection
  • Next by thread: Re: Events by starting an application (better explained) solved
  • Index(es):
    • Date
    • Thread