获取沙盒路径的分类
2016-05-25 22:58
190 查看
#import "NSString+sandBox.h"
@implementation NSString (sandBox)
//cache目录
- (instancetype)appdentCache
{
return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
NSUserDomainMask,
YES) lastObject]
stringByAppendingPathComponent:[self
lastPathComponent]];
}
//Documents 目录
- (instancetype)appdentDocuments
{
return [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES) lastObject]
stringByAppendingPathComponent:self.lastPathComponent];
}
//Temp目录
- (instancetype)appdentTemp
{
return [NSTemporaryDirectory()
stringByAppendingPathComponent:self.lastPathComponent];
}
@end
@implementation NSString (sandBox)
//cache目录
- (instancetype)appdentCache
{
return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
NSUserDomainMask,
YES) lastObject]
stringByAppendingPathComponent:[self
lastPathComponent]];
}
//Documents 目录
- (instancetype)appdentDocuments
{
return [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES) lastObject]
stringByAppendingPathComponent:self.lastPathComponent];
}
//Temp目录
- (instancetype)appdentTemp
{
return [NSTemporaryDirectory()
stringByAppendingPathComponent:self.lastPathComponent];
}
@end
相关文章推荐
- Android的文件存储方式
- hello
- 《大企业云桌面部署实战》公开课-报名了
- [leetcode]231. Power of Two
- c++作业6
- 《啊哈!算法》
- java中数据类型转换
- 冲刺 03
- CodeVS 3027 线段覆盖2
- 初夏黄河岸边风光(20160523)
- Audio 对象属性
- C++第6次作业
- 重新认识装饰模式--装饰模式实现AOP
- 高德地图-添加自定义图标
- Python菜鸟之路:Python基础——函数
- 毕业设计总结——自闭症儿童识别面部表情训练系统
- 小项目分析之C++ 实现模拟银行排队
- jqueryUI的dialog报错
- python web框架cherrypy小demo
- HDOJ 1130 卡塔兰数