//1,获取家目录路径的函数:
NSString*homeDir =NSHomeDirectory();
//2,获取Documents目录路径的方法:
NSArray*documentPaths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString*docDir = [documentPathsobjectAtIndex:0];
//3,获取Caches目录路径的方法:
NSArray*cachesPaths =NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES);
NSString*cachesDir = [cachesPathsobjectAtIndex:0];
//4,获取tmp目录路径的方法:
NSString*tmpDir =NSTemporaryDirectory();
NSLog(@"\n%@\n%@\n%@\n%@", homeDir, docDir, cachesDir, tmpDir);