沙盒

2016-08-12  本文已影响6人  雨沫的鱼

NSString *rootPath=NSHomeDirectory();

NSLog(@"根目录:%@",rootPath);

//查找documents文件夹路径

//    NSString *documentsPath=[NSString stringWithFormat:@"%@/Documents",rootPath];

//NSString类提供了快捷的方式完成***/**这种拼接模式

NSString *documentsPath=[rootPath stringByAppendingPathComponent:@"Documents"];

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

//获取library文件夹路径

NSString *libraryPath=[rootPath stringByAppendingPathComponent:@"Library"];

NSLog(@"Library:%@",libraryPath);

//tmp文件夹路径

NSString *tmpPath=[rootPath stringByAppendingPathComponent:@"tmp"];

上一篇下一篇

猜你喜欢

热点阅读