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); 
    
    
     
     
     
  • 相关阅读:
    Codeforces Round #301 (Div. 2) E . Infinite Inversions 树状数组求逆序数
    2017 计蒜之道 初赛 第三场 D. 腾讯狼人杀 (点边都带权的最大密度子图)
    UVALive
    Uvalive 7037 The Problem Needs 3D Arrays(最大密度子图)
    Straight Master Gym-101775J (思维+差分)
    Gym
    Gym 100548F Color 2014-2015 ACM-ICPC, Asia Xian Regional Contest (容斥原理+大数取模)
    牛客国庆集训派对Day3 I.
    HDU
    HDU
  • 原文地址:https://www.cnblogs.com/cfl911014/p/6596204.html
Copyright © 2011-2022 走看看