Created
March 20, 2012 03:00
-
-
Save matthewhudson/2130572 to your computer and use it in GitHub Desktop.
Create folder if doesn't exist
This file contains 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
// Documents directory | |
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains( | |
NSDocumentDirectory, | |
NSUserDomainMask, YES) | |
objectAtIndex:0]; | |
NSString *dataPath = [documentsPath stringByAppendingPathComponent:@"folderName"]; | |
// Create folder if does not exist. | |
if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath]) { | |
[[NSFileManager defaultManager] createDirectoryAtPath:dataPath | |
withIntermediateDirectories:NO | |
attributes:nil | |
error:&error]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment