2019独角兽企业重金招聘Python工程师标准>>>
//实例化filemanager
NSFileManager*fm=[NSFileManager defaultManager];
//获取桌面路径并创建新路径
NSArray*URLs=[fm URLsForDirectory:NSDesktopDirectory
inDomains:NSUserDomainMask];
if (URLs.count>0) {
NSURL*url=[URLs objectAtIndex:0];
NSString*new_path=url.path;//获取路径
new_path=[new_path stringByAppendingString:@"/shen"];//追加
路径
NSLog(@"%@",new_path);
//创建路径
BOOL r=[fm createDirectoryAtPath:new_path
withIntermediateDirectories:YES attributes:nil error:nil];
NSLog(@"%@",r==1?@"yes":@"no");
}