NSKeyValueChangeSetting and change dictionary values
NSKeyValueChangeSetting and change dictionary values
- Subject: NSKeyValueChangeSetting and change dictionary values
- From: Romain Brestac <email@hidden>
- Date: Sun, 3 Sep 2006 12:03:03 +0200
Hello list,
I have a class KVO compliant for an array "kvoArray". I wanted to
insert several objects in the array and then retrieve an array of new
objects in the observeValueForKeyPath method.
Because I didn't find a way to add several objects to an array in a
kvo compliant manner, I did this:
[self willChangeValueForKey:@"kvoArray"];
[kvoArray addObjects: objectOne, two, three,nil];
[self didChangeValueForKey:@"kvoArray"];
The documentation states that the NSKeyValueChangeKindKey value will
be in this case: NSKeyValueChangeSetting. That's right. But then, in
the NSKeyValueChangeNewKey and NSKeyValueChangeOldKey I don't get
expected results (i.e before and after the change) but empty arrays.
Is there something I did wrong ? did anybody face the same issue ?
Thanks. Romain.
Note: I added an observer with options NSKeyValueObservingOptionNew |
NSKeyValueObservingOptionOld and everything goes fine when
NSKeyValueChangeKindKey value is NSKeyValueChange(Insertion | Removal).
_______________________________________________
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