CommitValuesForKeys returns empty dictionary to subclass of NSManaged object
I am using a subclass of the NSManaged object that was generated by the core GUI tool in Xcode.
The NSLog'ing of the object shows it was creating and storing the values correctly ... But if I try to use something like this:
[generatedSubClass committedValuesForKeys:nil]
I am returning an empty dictionary.
source to share
The docs state that committedValuesForKeys
Returns a dictionary of the last selected or saved receiver values for the properties specified by these keys.
It follows that the object you are transferring is not the last one selected or saved.
Also note that committedValuesForKeys
is is an instance method, not a class method.
So not
but [managedObjectSubclass committedValuesForKeys:nil]
[aManagedObject committedValuesForKeys:nil]
source to share