//获取沙盒根目录
//1用NSHomeDirectory()
NSString *path = NSHomeDirectory();
NSLog(@"path : %@",path);
//2 用NSUserName()
NSString *userName = NSUserName();
NSString *rootPath = NSHomeDirectoryForUser(userName);
NSLog(@"rootPath : %@",rootPath);
//获取document路径 用来存取数据文件
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSLog(@"documentPath %@",documentPath);
//获取tmp路径 存储临时文件 再次启动的时候不会再有
NSString *tmpPath = NSTemporaryDirectory();
NSLog(@"tmpPath %@",tmpPath);
//获取caches路径 用来存取下次启动时所需的文件
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);
NSString *cachesDir = [paths objectAtIndex:0];
NSLog(@"cachesDir %@",cachesDir);