• 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: Monitoring an NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitoring an NSArrayController


  • Subject: Re: Monitoring an NSArrayController
  • From: mmalc crawford <email@hidden>
  • Date: Thu, 9 Aug 2007 07:25:30 -0700


On Aug 9, 2007, at 6:12 AM, Michael Fey wrote:

[vegetableController addObserver:self forKeyPath:@"arrangedObjects.name" (NSKeyValueObservingOptionNew| NSKeyValueObservingOptionOld) context:NULL];

Our observer method then looks like this:
- (void)observeValueForKeyPath:(NSString*)keyPath ofObject: (id)Object change:(NSDictionary*)change context:(void*)context
{
if ([keyPath @"arrangedObjects.name"]) {


It is typically better form to provide a context and test that rather than a keypath.

The problem that we're running into is that [change objectForKey:NSKeyValueChangeNewKey] is always coming up null (as is objectForKey:NSKeyValueChangeOldKey). Also, the keyValueChangeKind always seems to be NSKeyValueChangeSetting, even when we're adding to the NSArrayController through the GUI. Can someone point us in the right direction?

<http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>

mmalc

_______________________________________________

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: 
 >Monitoring an NSArrayController (From: Michael Fey <email@hidden>)

  • Prev by Date: Cocoa and PICT
  • Next by Date: Re: Accessing window in NSAlert didEndSelector:
  • Previous by thread: Monitoring an NSArrayController
  • Next by thread: Hiding MainMenu.nib contents for NSStatusBar based applicatiton
  • Index(es):
    • Date
    • Thread