• 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
triggerChangeNotificationsForDependentKey in subclass of NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

triggerChangeNotificationsForDependentKey in subclass of NSArrayController


  • Subject: triggerChangeNotificationsForDependentKey in subclass of NSArrayController
  • From: Gabriele de Simone <email@hidden>
  • Date: Thu, 7 Oct 2004 11:57:39 -0400

Esteemed members of the Cocoa Bindings cult,

It seems that if I add a new key to an NSArrayController and make "arrangedObjects" dependent on that key, the change notifications when the key is modified are never sent (or at least my views dependent on "arrangedObjects" don't get updated). Here's the scenario:

+ (void) initialize {
[self exposeBinding:@"myKey"];
[self setKeys:[NSArray arrayWithObjects:@"myKey", nil]
triggerChangeNotificationsForDependentKey:@"arrangedObjects"];
}

+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {

if ([key isEqualToString:@"myKey"]) {
return NO;
}

return [super automaticallyNotifiesObserversForKey:key];
}

- (void) setMyKey:(NSString*)myKey {

if (_myKey != myKey) {
[self willChangeValueForKey:@"myKey"];
_myKey = [myKey copy];
[self didChangeValueForKey:@"myKey"];
}
}

The obvious solution is to call [self rearrangeObjects] in the setter method, but I am more interested in knowing whether I have misunderstood/ignored some properties of NSControllers.

Thanks,
Gabriele

_______________________________________________
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: triggerChangeNotificationsForDependentKey in subclass of NSArrayController
      • From: Jacob Lukas <email@hidden>
    • Re: triggerChangeNotificationsForDependentKey in subclass of NSArrayController
      • From: Shaun Wexler <email@hidden>
  • Prev by Date: Putting things in subfolders in Resources folder
  • Next by Date: Re: triggerChangeNotificationsForDependentKey in subclass of NSArrayController
  • Previous by thread: Putting things in subfolders in Resources folder
  • Next by thread: Re: triggerChangeNotificationsForDependentKey in subclass of NSArrayController
  • Index(es):
    • Date
    • Thread