2

If I record an audio file and I have a core data object representing that recording... should I be referencing just the url to the recording on disk, or could I just store it within core data?

It's probably easier to just store it within core data, but doesn't sound like a very good idea.

Nosredna
  • 83,000
  • 15
  • 95
  • 122
dizy
  • 7,951
  • 10
  • 53
  • 54

2 Answers2

6

I would store the path to the file. This would be better because you can pass around the path until you actually need to play the file.

Dan Lorenc
  • 5,376
  • 1
  • 23
  • 34
1

Writing down entities in Core Data is atomic if I remember. So if you are going to save down the data I'd go with a path. If the application is only going to be reading relatively small to medium blobs you would be fine with a one-to-one related entity I think.

Also with the limited memory in the iPhone keeping data as files will let you mmap them.

Community
  • 1
  • 1
monowerker
  • 2,951
  • 1
  • 25
  • 23