//實例化filemanagerurl
NSFileManager*fm=[NSFileManager defaultManager];spa
//獲取桌面路徑並建立新路徑orm
NSArray*URLs=[fm URLsForDirectory:NSDesktopDirectorystring
inDomains:NSUserDomainMask];it
if (URLs.count>0) {object
NSURL*url=[URLs objectAtIndex:0];file
NSString*new_path=url.path;//獲取路徑error
new_path=[new_path stringByAppendingString:@"/shen"];//追加margin
路徑top
NSLog(@"%@",new_path);
//建立路徑
BOOL r=[fm createDirectoryAtPath:new_path
withIntermediateDirectories:YES attributes:nil error:nil];
NSLog(@"%@",r==1?@"yes":@"no");
}