// 查找当前应用的沙盒根目录
NSString * rootPath = NSHomeDirectory();
NSLog(@"%@",rootPath);
//查找Documents文件夹路径,就是在根目录后面加/Documents
// NSString * documentsPath = [NSString stringWithFormat:@"%@/Documents",rootPath];
// NSString 类 提供了快捷的方式来完成***/***这种拼接模式
NSString * documentsPath = [rootPath stringByAppendingPathComponent:@"Documents"];
//获取Library文件夹路径
NSString * LibraryPath = [rootPath stringByAppendingPathComponent:@"Library"];
//获取tmp文件夹路径
NSString * tmpPath = [rootPath stringByAppendingPathComponent:@"tmp"];
//查找文件路径
//directory :目录
//domain :领域
/*
参数1 :获取的目录对应的枚举值
参数2 :规定从哪个域中搜索
参数3 :是否拓展, YES 全路径打印。 NO 则只打印~/Documents
*/
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString * documentsPath1 = paths.firstObject;
//获取Lirary文件夹路径
NSString * libraryPath1 = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject;
//获取cache文件夹(用得不多)
NSString * cachePaht = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
//获取tmp文件夹路径,比较特殊,用得多,系统给了一个特殊方式。
NSString * tmpPath1 = NSTemporaryDirectory();
//获取应用本身的目录,如果要搜的是当前应用下的文件则用NSbundle
NSString * jpgpath =[[NSBundle mainBundle] pathForResource:@"11" ofType:@"jpg"];//这里获取一张文件中图片的地址
//NSLog(@"jpg Path:%@",jpgpath);
//如果搜索的是xcode左边那些文件则要用nsbundle方法