Question

I have a subclass of NSManagedObject on which there's a "currency" attribute. This attribute is a 3 letters string. When I change it from "USD" to "CAD", and then call changedValues on the object, changedValues returns an empty dictionary. Is that the normal behaviour?

I save the managedObjectContext first, then change the attribute, then call changedValues.

This attribute is: not transient, optional, not indexed, no default value.

EDIT: Thx for the help guys I found a bug in my code. Now it works just fine.

Was it helpful?

Solution

I found a bug in my code. Now it works just fine. ;)

I was using a delegate method to update the object from another viewController. When coming back from that viewController I saved the managedObjectContext in viewWillAppear which basically erased the changedValues.

OTHER TIPS

Do it before you save the context.

NSManagedObject Class Reference

changedValues

Returns a dictionary containing the keys and (new) values of persistent properties that have been changed since last fetching or saving the receiver.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top