ios - How to store many images and .mp3 files in core data for iphone? -
i new core data , trying learn how store large files, images , short .mp3s. app has 300 different images , short .mp3s triggered displayed/played user interaction, , far can tell, should use core data storing these files.
i added core data .xc file xcode project, , created entity attributes. chose attribute named "binary data" , checked box "allows external storage," i've read allows me persistently sore files on 5.x or newer ios phones. know can program app , set these attributes, how store images , music files here?
please me code/understanding. seems me should able somehow use core data interface set bunch of entities containing attributes of "binary data" images , .mp3s, , whenever need display pic or play sound, call entity , attributes.
thanks help!
i store compressed images (jpegs) core data , seems fast enough. these compressed < 100k.
if want store items bigger 100k, might want save file "disk" doing along lines of write file on ios
then, save file path string in core data. load file, file path core data read file in.
i think apple recommends cutoff @ 100k.
Comments
Post a Comment