久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用新的外部存儲標志將 UIImage 存儲在核心數(shù)據(jù)

Storing UIImage in Core Data with the new External Storage flag(使用新的外部存儲標志將 UIImage 存儲在核心數(shù)據(jù)中)
本文介紹了使用新的外部存儲標志將 UIImage 存儲在核心數(shù)據(jù)中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我知道 UIImage 在核心數(shù)據(jù)中的存儲已經(jīng)討論了很多,例如 這里,但那是 ios5 之前的版本.現(xiàn)在我們有了外部存儲標志,你們認為將 UIImage 直接存儲在實體中、作為單獨的實體還是仍然在磁盤上是一個好主意?

這里是解釋外部存儲選項的來源.

解決方案

iOS 5.0 核心數(shù)據(jù)發(fā)布說明

<塊引用>

啟用后,Core Data 會啟發(fā)式地根據(jù)每個值決定是否它應該將數(shù)據(jù)直接保存在數(shù)據(jù)庫中或?qū)?URI 存儲到它為您管理的單獨文件.您不能根據(jù)如果使用此選項,則為二進制數(shù)據(jù)屬性的內(nèi)容.

從您的鏈接 外部二進制數(shù)據(jù),啟發(fā)式似乎是

<塊引用>

小于 1MB 的對象存儲在數(shù)據(jù)庫中.為了更大的對象,創(chuàng)建一個外部文件和數(shù)據(jù)庫只是存儲對它的引用.

所以以下建議仍然有效:CoreData : store是否將圖像轉(zhuǎn)入數(shù)據(jù)庫?

<塊引用>
  • <100kb 與相關數(shù)據(jù)存儲在同一個表中
  • <1mb 存儲在通過關系附加的單獨表中,以避免不必要地加載
  • <塊引用>

    1mb 存儲在磁盤上并在 Core Data 中引用它

該標志設置 Core Data 遵循該建議并自動將 >1MB 的圖像存儲為單獨的磁盤文件.

I know that the storing of UIImage's in core data has been discussed a lot, such as here, but that was pre-ios5. Now that we have the external storage flag, do you guys think it would be a fine idea to store UIImage's directly in the entity, as a separate entity, or still on the disk?

Here is a source explaining the external storage option.

解決方案

Core Data Release Notes for iOS 5.0

When enabled, Core Data heuristically decides on a per-value basis if it should save the data directly in the database or store a URI to a separate file which it manages for you. You cannot query based on the contents of a binary data property if you use this option.

And from your link External Binary Data, the heuristic seems to be

Objects that are smaller than 1MB are stored in the database. For objects that are larger, an external file is created and the database just stores a reference to it.

So the following advice is still valid: CoreData : store images to DB or not?

  • < 100kb store in the same table as the relevant data
  • < 1mb store in a separate table attached via a relationship to avoid loading unnecessarily
  • 1mb store on disk and reference it inside of Core Data

The flag sets Core Data to follow that advice and automatically store images >1MB as a separate disk file.

這篇關于使用新的外部存儲標志將 UIImage 存儲在核心數(shù)據(jù)中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

EditText with SpannableStringBuilder and ImageSpan doesn#39;t works fine(帶有 SpannableStringBuilder 和 ImageSpan 的 EditText 不能正常工作)
Align ImageView with EditText horizontally(將 ImageView 與 EditText 水平對齊)
How to remove Address Bar in Safari in iOS?(如何在 iOS 中刪除 Safari 中的地址欄?)
Having trouble creating UIImage from CIImage in iOS5(在 iOS5 中從 CIImage 創(chuàng)建 UIImage 時遇到問題)
Get list of all photo albums and thumbnails for each album(獲取所有相冊的列表和每個相冊的縮略圖)
Can anybody help me in recording iPhone output sound through Audio Unit(誰能幫我通過音頻單元錄制 iPhone 輸出的聲音)
主站蜘蛛池模板: 欧美日韩国产三级 | 欧美大片一区 | 在线中文字幕国产 | 国产一级一级毛片 | 一级做a爰片性色毛片 | 国产探花在线精品一区二区 | 久久高清免费视频 | 亚洲成人精品在线 | 国产成人免费视频网站高清观看视频 | 91看片在线 | 国内精品在线视频 | 日韩欧美一级精品久久 | 久久精品中文 | 国产日韩精品在线 | 91视频在线看 | 成人免费视频网站在线观看 | 免费在线播放黄色 | 黄频视频| 羞羞视频在线网站观看 | 日韩一级电影免费观看 | 91精品国产综合久久久亚洲 | 久久在线| 免费同性女女aaa免费网站 | 久久不卡| 国产高清自拍视频在线观看 | 国产二区精品视频 | 一区二区三区四区五区在线视频 | 伊人久久一区二区 | 中文字幕亚洲无线 | 欧美一区二区三区久久精品 | 久久aⅴ乱码一区二区三区 亚洲国产成人精品久久久国产成人一区 | 蜜臀久久99精品久久久久久宅男 | 亚洲天堂日韩精品 | 精品日韩一区二区 | 国产精品毛片久久久久久久 | 欧美一级片免费看 | 91在线观看| 亚州精品天堂中文字幕 | 久久久久久久综合色一本 | 亚洲 日本 欧美 中文幕 | 色视频成人在线观看免 |