Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created January 2, 2013 20:07
Show Gist options
  • Select an option

  • Save codeswimmer/4437489 to your computer and use it in GitHub Desktop.

Select an option

Save codeswimmer/4437489 to your computer and use it in GitHub Desktop.
iOS: How To Access The Application Temporary Directory
Getting a reference to your application’s temporary directory is even easier than getting a reference to the Documents directory. The Foundation function called NSTemporaryDirectory() will return a string containing the full path to your application’s temporary directory. To create a filename for a file that will get stored in the temporary directory, we first find the temporary directory:
NSString *tempPath = NSTemporaryDirectory();
Then, we create a path to a file in that directory by appending a filename to that path, like this:
NSString *tempFile = [tempPath stringByAppendingPathComponent:@”tempFile.txt”];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment