Mac开发中,问一下怎么样编码实现操作finder打开指定目录,谢谢!如图:
解决方案
20
let openDlg = NSOpenPanel();
openDlg.canChooseFiles = false;
openDlg.canChooseDirectories = true;
openDlg.directoryURL? = NSURL(string: “这里写你要打开的目录”)!
openDlg.beginWithCompletionHandler { (isOpen) in
if (isOpen == 1)
{
openDlg.canChooseFiles = false;
openDlg.canChooseDirectories = true;
openDlg.directoryURL? = NSURL(string: “这里写你要打开的目录”)!
openDlg.beginWithCompletionHandler { (isOpen) in
if (isOpen == 1)
{
}
};