Skip to content

Instantly share code, notes, and snippets.

@linktoming
Created December 29, 2011 02:17
Show Gist options
  • Save linktoming/1531202 to your computer and use it in GitHub Desktop.
Save linktoming/1531202 to your computer and use it in GitHub Desktop.
iOS File and Direcotry
// Document Folder
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filename = [documentsDirectory stringByAppendingPathComponent:@"theFile.txt"];
// Temp Folder
NSString *tempPath = NSTemporaryDirectory();
NSString *tempFile = [tempPath stringByAppendingPathComponent:@"tempFile.txt"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment