//数据存储的路径-----

  //数据存储的路径-----也就是改放到哪里

    

    //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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值