iPhone:在Core Data中存储视频和音频? [英] iPhone: Storing video and audio in Core Data?
问题描述
我需要为使用Core Data的现有应用程式新增影片和音讯录音功能。我一直在想我应该将它们保存到文件系统,并使用Core Data引用它们,但我想知道我是否可以将它们放入Core Data作为Transformable属性,并忽略文件系统?
I need to add video and audio recording functionality to an existing app that uses Core Data. I've been thinking that I should save them to the file system and reference them using Core Data but I wondered if I can put them into Core Data as Transformable attributes and ignore the file system altogether?
我的直觉是,这是一个真正的坏主意™。我喜欢使用核心数据的轻松和增值。但我试图搜索iphone核心数据视频,但只是返回堆的核心数据教程。
My gut feeling is that this is a Really Bad Idea™. I do like the ease and value-add of using Core Data however.. I've tried searching for 'iphone core data video' but that just returns heaps of core data tutorials.
推荐答案
当使用coredata保存二进制数据时,Coredata有一个允许外部存储选项,将自动存储大于1mb的文件磁盘。
Coredata has a 'allow external storage' option when saving binary data with coredata which will automatically store files larger than 1mb to the disk.
但是,此问题与以下问题非常相似:
However, this question is very similar to these questions:
Storing large (e.g. image/movie) files in Core Data on the iPhone
与所选择的答案,Core Data应该能够保持良好的性能,只要没有大量的视频或照片。
In contrast to the selected answer, Core Data should be able to maintain good performance as long as there isn't a huge amount of videos or photos.
这篇关于iPhone:在Core Data中存储视频和音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!