ios目录

//获取根目录

    NSString*homePath = NSHomeDirectory();

    NSLog(@"Home目录:%@",homePath);

    

    //获取Documents文件夹目录,第一个参数是说明获取Doucments文件夹目录,第二个参数说明是在当前应用沙盒中获取,所有应用沙盒目录组成一个数组结构的数据存放

    NSArray*docPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);

    NSString*documentsPath = [docPath objectAtIndex:0];

    NSLog(@"Documents目录:%@",documentsPath);

    

    //获取Cache目录

    NSArray*cacPath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);

    NSString*cachePath = [cacPath objectAtIndex:0];

    NSLog(@"Cache目录:%@",cachePath);

    

    //Library目录

    NSArray*libsPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);

    NSString*libPath = [libsPath objectAtIndex:0];

    NSLog(@"Library目录:%@",libPath);

    

    //temp目录

    NSString*tempPath = NSTemporaryDirectory();

    NSLog(@"temp目录:%@",tempPath);

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值