What can I do with an Transformable attribute type in Core Data on the iPhone?

后端 未结 1 653
执笔经年
执笔经年 2021-01-30 06:13

There\'s this Transformable data type for attributes. What is it good for? Are there good examples?

I\'d like to play around with this. So after searching a while I came

相关标签:
1条回答
  • 2021-01-30 07:15

    Transformable attributes are useful for storing nonstandard object types within Core Data. For example, I provide code in this answer that lets you store UIImages as an attribute within Core Data. The image data is converted to and from an NSData instance that contains the image's PNG representation. This is all handled transparently for you by a custom NSValueTransformer.

    You may also wish to encrypt individual attributes within your Core Data model, as I describe here. Using a transformable attribute for this makes this trivial to code.

    0 讨论(0)
提交回复
热议问题