zoukankan      html  css  js  c++  java
  • iOS沙盒

    Documents   苹果建议将程序中创建的或在程序中浏览到的文件数据保存在该目录下,iTunes备份和恢复的时候会包括此目录;
    Library         存储程序的默认设置或其它 状态信息;
                       Caches:存放缓存文件,iTunes不会备份此目录,此目录下文件不会在应用退出删除;
    tmp             创建和存放临时文件的地方。 
     
    1        //获取根目录 
    2         NSString *homePath = NSHomeDirectory(); 
    3         NSLog(@"Home目录:%@",homePath);         
    4
    5         //获取Documents文件夹目录,第一个参数是说明获取Doucments文件夹目录,第二个参数说明是在当前应用沙盒中获取,所有应用沙盒目录组成一个数组结构的数据存放 
    6         NSArray *docPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); 
    7         NSString *documentsPath = [docPath objectAtIndex:0]; 
    8         NSLog(@"Documents目录:%@",documentsPath);
    15         //Library目录 
    16         NSArray *libsPath = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); 
    17         NSString *libPath = [libsPath objectAtIndex:0]; 
    18         NSLog(@"Library目录:%@",libPath); 
    10         //获取Cache目录  (缓存文件 SDWebImage)
    11         NSArray *cacPath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);  
    12         NSString *cachePath = [cacPath objectAtIndex:0];  
    13         NSLog(@"Cache目录:%@",cachePath);  
    
    
    
    20         //temp目录  
    21         NSString *tempPath = NSTemporaryDirectory();  
    22         NSLog(@"temp目录:%@",tempPath); 
    
    
     
     
     
  • 相关阅读:
    centos7.6 安装与配置 MongoDB yum方式
    MongoDB 介绍
    centos 关闭selinux
    前端 HTML标签属性
    前端 HTML 标签嵌套规则
    前端 HTML 标签分类
    前端 HTML body标签相关内容 常用标签 表单标签 form里面的 input标签介绍
    前端 HTML body标签相关内容 常用标签 表单标签 form 表单控件分类
    前端 HTML form表单标签 select标签 option 下拉框
    POJ 1426
  • 原文地址:https://www.cnblogs.com/cfl911014/p/6596204.html
Copyright © 2011-2022 走看看