4

I am trying to save a CATransform3D in a Core Data store. In my custom NSObject subclass I use:

self.transform = [NSValue valueWithCATransform3D: inputTransform ];

to convert the input CATransform3D to an NSValue. NSLog shows what looks like the expected transform:

2012-10-02 18:12:27.019 Model Importer[27908:303] Transform: <00000000 0000f03f 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000f03f 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000f03f 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000f03f>

From everything I've read NSValue, by implementing NSCoding (through NSSecureCoding), should be storable when specified as Transformable in the model. However, when writing to the store I get the exception:

[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs

I have other Transformable attributes of type CIColor that seem to be working fine.

I'm sure there are many other ways I could store the CATransform3D attributes, but I'd like to understand what's not working here, to avoid running into similar situations.

For what it's worth, at this point the store is set to the default binary, but this doesn't look to me like it would depend on the store type.

Did I miss something, is this a known bug, or something else?

bneely
  • 9,083
  • 4
  • 38
  • 46
Steven McGrath
  • 1,717
  • 11
  • 20

0 Answers0