Core Data storedata file takes up too much space
I have only one entity, which has two attributes: an NSString attribute and a transformable attribute for image storage.
When I creat six entities with six images whose sizes are about 1.7MB, the storedata file now takes up 19.6MB space using NSBinaryStoreType or NSSQLiteStoreType.
That is unacceptable, am I going wrong with Core Data? Or just this is natural of Core Data? How can I reduce the storedata开发者_C百科 file size? Thanks a lot.
Store the images in external files, then store the path to them as a string in Core Data.
In Mac OS Lion, managed objects can store their attributes externally. See http://developer.apple.com/library/mac/#releasenotes/DataManagement/RN-CoreData/_index.html#//apple_ref/doc/uid/TP40010637-CH1-DontLinkElementID_2
精彩评论