Search code examples
macosfiletemporary

Storing temporary files


I would like to generate some temporary files in the course of my application. Specifically, I'm using AVAudioRecorder to record a file that I, upon stopping the recording, would like to load and edit/process. My question is:

What is the appropriate standard place to create temporary files. Is there some generally accepted approach to this for Mac or for iPad programming in general? I don't want to simply create a directory and write files into it if there is a proper protocol to this.


Solution

  • The answer to this question is actually a lot more complicated then one might assume. One cannot necessarily just use NSTemporaryDirectory and be done. I cocoadev.com has some good pages on this topic and I would suggest that you study them yourself and determine what will work best for your circumstance.

    http://www.cocoadev.com/index.pl?NSTemporaryDirectory

    http://www.cocoadev.com/index.pl?GettingTemporaryFolderOnSpecificVolume