Is there a way to get the object that has been added using addObserver:forKeyPath:options:context:
with option NSKeyValueChangeInsertion
on an NSManagedObject
?

- 7,635
- 7
- 48
- 66
1 Answers
Yes. From the documentation for observeValueForKeyPath:ofObject:change:context:
:
change
A dictionary that describes the changes that have been made to the value of the property at the key path keyPath relative to object. Entries are described in “Keys used by the change dictionary.”
And further down:
NSKeyValueChangeKindKey
An NSNumber object that contains a value corresponding to one of the NSKeyValueChangeKindKey enumerations, indicating what sort of change has occurred.
NSKeyValueChangeIndexesKey
If the value of the NSKeyValueChangeKindKey entry is NSKeyValueChangeInsertion, NSKeyValueChangeRemoval, or NSKeyValueChangeReplacement, the value of this key is an NSIndexSet object that contains the indexes of the inserted, removed, or replaced objects.

- 135,006
- 31
- 278
- 256
-
Thank you very much, I somehow missed it. – sharvey Dec 09 '10 at 21:29