Storing blobs in external location using built-in CoreData option

我的未来我决定 提交于 2019-11-30 06:51:44
marcusg

If your store type is NSSQLiteStoreType, your attribute is NSBinaryDataAttributeType. You have enabled setAllowsExternalBinaryDataStorage and your object data size is larger then approximately 1MB.

  • Objects that are smaller than 1MB are stored in the sqlite database.
  • Objects that are larger are just a reference to a external file.

You'll find the (external) files in a hidden sub-directory at the same location as the persistent store.

<path>/<database>.sqlite
<path>/<your_database>_SUPPORT/_EXTERNAL_DATA/

sqlite2 does not allow size of BLOB data to be more than 1MB,However sqlite 3 allows larger BLOB.First check out which version of sqlite u r using. And if ur file is in MB's i would rather prefer them storing in local database instead.

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