NSString *homePath = NSHomeDirectory();
NSLog(@"home根目录:%@", homePath);
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
NSLog(@"documens路径:%@", documentPath);
NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
NSLog(@"libaray路径:%@", libraryPath);
NSString *tmpPath = NSTemporaryDirectory();
NSLog(@"tmp路径:%@", tmpPath);
另一种方法
NSString *documents = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *path = [documents stringByAppendingPathComponent:@"header.png"];