获取App的Documents路径

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

1. 

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

  这种写法不是很严谨

2.

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

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

原文地址:https://www.cnblogs.com/huangzizhu/p/3714975.html