Mac开发中,问一下怎么样编码实现操作finder打开指定目录,谢谢

iOS 码拜 7年前 (2017-04-16) 1305次浏览
Mac开发中,问一下怎么样编码实现操作finder打开指定目录,谢谢!如图:Mac开发中,问一下怎么样编码实现操作finder打开指定目录,谢谢
解决方案

20

let openDlg = NSOpenPanel();
openDlg.canChooseFiles = false;
openDlg.canChooseDirectories = true;
openDlg.directoryURL? = NSURL(string: “这里写你要打开的目录”)!
openDlg.beginWithCompletionHandler { (isOpen) in
if (isOpen == 1)
{

}
};


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Mac开发中,问一下怎么样编码实现操作finder打开指定目录,谢谢
喜欢 (0)
[1034331897@qq.com]
分享 (0)