首页 > 移动平台 > 详细

获取App的Documents路径

时间:2014-05-08 09:28:22      阅读:458      评论:0      收藏:0      [点我收藏+]

有两种写法可以获取到Documents的路径

1. 

1
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];

  这种写法不是很严谨

2.

1
2
NSArray *filePath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentPath = [filePath objectAtIndex:0];

  这种获取路径的方法比较好,不是自己写死了路径。

 

获取App的Documents路径,布布扣,bubuko.com

获取App的Documents路径

原文:http://www.cnblogs.com/huangzizhu/p/3714975.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!