Why is my transformable Core Data attribute not using my custom NSValueTransformer?

后端 未结 6 608
故里飘歌
故里飘歌 2020-11-27 17:08

I have a Core Data app with a fairly simple data model. I want to be able to store instances of NSImage in the persistent store as PNG Bitmap NSData objects, to save space.<

6条回答
  •  执笔经年
    2020-11-27 17:49

    It seems registering the transformer has no effect on wether Core Data will use it or not. I've been playing with the PhotoLocations sample code and removing the transformer registration has no effect. As long as your ValueTransformerName is the name of your class, and that your transformer's implementation is included with the target, it should work.

    If there is no code execution in the transformer, then the code in the transformer is irrelevant. The problem must be somewhere else in the core data stack, or in the declaration of the transformer.

提交回复
热议问题