//1,获取沙盒目录路径的函数:
NSString *homeDir = NSHomeDirectory();
//2,获取Documents目录路径的方法:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *docDir = [paths objectAtIndex:0];
//3,获取Caches目录路径的方法:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES);
NSString *cachesDir = [paths objectAtIndex:0];
//4,获取tmp目录路径的方法:
NSString *tmpDir = NSTemporaryDirectory();
时间: 2024-10-14 13:06:54