【代码笔记】iOS-NSSearchPathForDirectoriesInDomainsDemo_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > 【代码笔记】iOS-NSSearchPathForDirectoriesInDomainsDemo

【代码笔记】iOS-NSSearchPathForDirectoriesInDomainsDemo

 2017/8/4 15:31:37  弦外雨  程序员俱乐部  我要评论(0)
  • 摘要:一,代码。-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.//得到documents目录NSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)
  • 标签:笔记 for iOS 代码 CTO

一,代码。

class="cnblogs_code_copy" style="font-size: 18px">复制代码
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    //得到documents目录
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSLog(@"---path--%@",paths);
    NSLog(@"----documentsDirectory--%@",documentsDirectory);
    
}
复制代码

 

二,输出。

2015-10-23 11:20:45.784 NSSearchPathForDirectoriesInDomainsDemo[5762:138082] ---path--(
    "/Users/chenlihua/Library/Developer/CoreSimulator/Devices/78D1FCBF-9990-471F-9075-168F2CE949FE/data/Containers/Data/Application/90BF1948-F0C9-408D-ACA1-B8BE6A0FA338/Documents"
)
2015-10-23 11:20:45.784 NSSearchPathForDirectoriesInDomainsDemo[5762:138082] ----documentsDirectory--/Users/chenlihua/Library/Developer/CoreSimulator/Devices/78D1FCBF-9990-471F-9075-168F2CE949FE/data/Containers/Data/Application/90BF1948-F0C9-408D-ACA1-B8BE6A0FA338/Documents
发表评论
用户名: 匿名