Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone: Storing video and audio in Core Data?

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?

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.

like image 615
nikkumang Avatar asked Nov 06 '10 20:11

nikkumang


1 Answers

Don't put binary data in Core Data. Store them on the file system and store a reference to the file system location in Core Data.

If you store them in Core Data you risk blowing the cache and causing terrible performance, not to mention probably blowing out memory as you try to fault in a large amount of data.

like image 182
Marcus S. Zarra Avatar answered Oct 21 '22 05:10

Marcus S. Zarra