Why can adding an KVO call didChangeValueForKey:
Why can adding an KVO call didChangeValueForKey:
- Subject: Why can adding an KVO call didChangeValueForKey:
- From: "Ian G. Gillespie" <email@hidden>
- Date: Thu, 10 Nov 2005 13:35:16 -0500
I have a simple to-many relationships setup using NSTreeControllers
with a source-list and contents type UI (ala iTunes). I over-ride
awakeFromFetch to add observers of the objects that the object
contains like this:
NSArray* newObjects = [[self valueForKey:@"items"] allObjects];
[newObjects addObserver:self
toObjectsAtIndexes:[NSIndexSet
indexSetWithIndexesInRange:NSMakeRange(0, [newObjects count])]
forKeyPath:@"name"
options:NSKeyValueObservingOptionNew
context:NULL];
I also overide observeValueForKeyPath:(NSString *)keyPath ofObject:
(id)object change:(NSDictionary *)change... to know when the observed
objects change. However, it seems that when my application first
launches and I select an item from the list on the left the
observerValue:keyPath:obObject gets called with the "name" key path
even though nothing has changed.
Is this behavior correct? For what it is worth, I am almost certain
that prior to 10.4.3 this was not the case.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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