Posted on 2013-01-07 23:23
RTY 閱讀(642)
評論(0) 編輯 收藏 引用 所屬分類:
Mac os 、
轉載隨筆
很多程序有這樣的功能,雙擊某個圖片可以打開源文件,右鍵菜單中的Show in Finder功能,Cocoa中對這塊支持較好,有現成的方法:
[[NSWorkspace sharedWorkspace] openFile:fileName];
[[NSWorkspace sharedWorkspace] selectFile:fileName inFileViewerRootedAtPath:path]; // 如果只打開目錄不需要選中具體文件,fileName可為nil。