Storing blobs in external location using built-in CoreData option

前端 未结 2 1896
轮回少年
轮回少年 2020-12-30 06:09

I have managed objects that have image properties. Since storing large blobs in CoreData is a bad idea, I\'m trying to use the built-in CoreData option \"Store in Ex

2条回答
  •  醉梦人生
    2020-12-30 06:54

    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.

    /.sqlite
    /_SUPPORT/_EXTERNAL_DATA/
    

提交回复
热议问题