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