I am trying to observe individual NSManagedObject
changes on NSManagedObjectContextWillSaveNotification
:
- (void)managedObjectContextWi
Do you have any transient attributes on your entity? I am seeing the behavior you describe, and I've written some test code that shows that modifying a transient attribute causes hasChanges
to return true
, while changedValues
is empty.
You can avoid this behavior by using setPrimitiveValue:forKey:
to modify your transient attribute or the equivalent method generated by Core Data (setPrimitiveFoo:
for an attribute named foo
). You could also implement the transient attribute's setter to do this for you.