标签:
1.获取APP程序路径
NSString *path = [NSHomeDirectory();
2.获取沙盒Documents
1.NSDocumentDirectory ---->要获取的Documents 2.NSUserDomainMask--->在当前应用程序下
NSCachesDirectory ----->缓存目录
NSString *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
或
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/data.plist"];
3.获取临时目录
NSString *path = NSTemporaryDirectory();
4.获取App程序应用包路径
NSString * path = [[NSBundle mainBundle] resourcePath];
标签:
原文地址:http://www.cnblogs.com/xiaoyixinfeng/p/4314706.html