I am using Core Data NSManagedObject (in an iOS application) with an attribute of type "transformable" to store a piece of data. Data is encoded / decoded using the NSKeyedUnarchiveFromData built-in value converter. The problem is that I was having problems setting NSManagedObject correctly after changing binary data. Let's say, for example, the code looks like this:
id temp = [myManagedObject myTransformableAttribute];
[myManagedObject setMyTransformableAttribute:temp];
NSError *error;
if(![[myManagedObject managedObjectContext] save:&error]) {
}
It seems to me that "reinstalling" the transformable attribute onto a managed object and saving the saved object should lead to the fact that the data will be transcoded using a NSKeyedUnarchiveFromData value transformer. But the encoder is never called, and updated data is not saved.
, . , ? - ? ...