To create a new directory in the directory of your application library, use this ...
// Generate the path to the new directory NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString *newDirectory = [NSString stringWithFormat:@"%@/new", [paths objectAtIndex:0]]; // Check if the directory already exists if (![[NSFileManager defaultManager] fileExistsAtPath:newDirectory]) { // Directory does not exist so create it [[NSFileManager defaultManager] createDirectoryAtPath:newDirectory withIntermediateDirectories:YES attributes:nil error:nil]; }
source share