获取根目录
NSString *homePath =NSHomeDirectory();
NSLog(@"Home: %@",homePath);
获取Documents文件夹目录
NSArray *docPathArr =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *docPath = [docPathArrobjectAtIndex:0];
NSLog(@"Document: %@",docPath);
获取Library文件目录
NSArray *libPathArr =NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,NSUserDomainMask,YES);
NSString *libPath = [libPathArrobjectAtIndex:0];
NSLog(@"Lib: %@",libPath);
获取临时文件目录
NSString *temPath =NSTemporaryDirectory();
NSLog(@"Tmp: %@",temPath);
检验文件是否存在
[[NSFileManagerdefaultManager] fileExistsAtPath:temPath]
获得某个文件的方法
NSString *kPlist = [temPath stringByAppendingPathComponent:@"data.plist"];
NSLog(@"PList: %@",kPlist);