How to create a subfolder in the document directory in iphone

how to create another folder in the document directory and then. I want to transfer some file in this folder that is created in the documents directory, then I want to make this folder as a zip file

Please help me on how to work on this.

+4
source share
1 answer

try it

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"/yourFolderName"]; if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath]) [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&error]; 
+5
source

Source: https://habr.com/ru/post/1416314/


All Articles