Need help debugging an exception in _encodeObject when using [NSValue valueWithCATransform3D:] to create a Transformable attribute

I am trying to save CATransform3D in a master data store. In my subclass of NSObject, I use:

self.transform = [NSValue valueWithCATransform3D: inputTransform ]; 

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

 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> 

Of everything that I read NSValue, through the implementation of NSCoding (via NSSecureCoding), should be preserved if the model specifies Transformable. However, when I write to the repository, I get an exception:

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

I have other Transformable attributes like CIColor that seem to work fine.

I am sure that there are many other ways to store CATransform3D attributes, but I would like to understand what does not work here to avoid a collision with similar situations.

For what it's worth, at the moment the binary is installed in the repository by default, but it does not look as if it will depend on the type of repository.

Am I missing something, is this a known bug or something else?

+4
source share

Source: https://habr.com/ru/post/1437501/


All Articles