1、获取Documents路径,2条代码:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = paths[0];
2、获取Library路径,2条代码:
NSArray paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libraryDirectory = paths[0];
3、获取tmp路径,1条代码:
NSString *tempPath = NSTemporaryDirectory();