Created
January 2, 2013 20:07
-
-
Save codeswimmer/4437489 to your computer and use it in GitHub Desktop.
iOS: How To Access The Application Temporary Directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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