//数据存储的路径-----也就是改放到哪里
//1. bundle 路径
NSString *bunPath = [NSBundle mainBundle].bundlePath;
// NSLog(@"bunPath - %@",bunPath);
//2.沙盒的路径
NSString *path = NSHomeDirectory();
// NSLog(@"path - %@",path);
//注意点 : 千万不要把大型数据 放到documents 里面 否则 无法上线
//: 这几个目录中 哪个可以 同步itunes documents preference(偏好设置)
//2.1 documents
// NSString *docPath = [NSString stringWithFormat:@"%@/Documents",path];
//2.1.1自动添加 / ,他会自动判断
NSString *docPath = [path stringByAppendingPathComponent:@"Documents"];
// NSLog(@"docPath --- %@",docPath);
// 出于以后考虑 若干年后 abc ,避免这个问题
/**
* 自动获取对应的 路径
* Domains 文件夹
* @param directory 查找哪个 文件夹下面的路径
* @param domainMask 用户文件夹
* @param expandTilde ~ 为NO, 如果 是YES 代表 全显示
*
* @return <#return value description#>
*/
NSString *docPath2 = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
// NSLog(@"docPath2 ------- %@",docPath2);
// --------------------------- 了解------------------------------------
//2.2 Library 路径
NSString *libPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) firstObject];
// NSLog(@"libPath ------- %@",libPath);
//2.3 tmp 路径
NSString *tmpPath = NSTemporaryDirectory();
// [NSSearchPathForDirectoriesInDomains(NSTemporaryDirectory(), NSUserDomainMask, YES) lastObject];
// NSLog(@"tmpPath ------- %@",tmpPath);
//2.4 caches 路径
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
NSLog(@"cachePath ------- %@",cachePath);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end