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); 
    
    
     
     
     
  • 相关阅读:
    10月23日总结
    10月22日总结
    10月21日总结
    使用Sklearn进行股票异常分析
    10月20日总结
    10月19日总结
    10月18日总结
    CF482E ELCA
    ERROR: Error installing mysql2: ERROR: Failed to build gem native extension [@Ubuntu 15.04]
    在Deepin 20.2系统中换源并全新图解安装MySQL数据库
  • 原文地址:https://www.cnblogs.com/cfl911014/p/6596204.html
Copyright © 2011-2022 走看看