Retrieve Path

Retrieve the path to the Documents directoru:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);

NSString *documentsDirectory = [paths objectAtIndex:0];

why the index is 0? Only one directory meets the criteria.

Getting the tmp Directory.

NSString *tmp = NSTemporaryDirectory();

NSString *tmpFile = [tmp stringByApendingPathComponent:@"tempFile.txt"];
原文地址:https://www.cnblogs.com/yk00/p/2954963.html