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

风流意气都作罢 提交于 2019-12-02 14:49:35
Brad Larson

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!