activateFileViewerSelectingURLs:
Finderで指定したファイルを選択・表示します。
- (void)activateFileViewerSelectingURLs:(NSArray *)fileURLsfunc activateFileViewerSelectingURLs(_ fileURLs: [AnyObject])
解説
Finderで指定したファイルを選択・表示します。
返り値
なし
引数
ファインダで選択・表示されるファイル
Objective-C(NSArray *)fileURLs(_ fileURLs: [AnyObject])
フレームワーク
ApplicationKit
クラス
NSWorkspace
使用可能
10.6-
更新時のバージョン
OS X 10.10
参照
関連記事(外部サイト)
例文
//NSWorkspace activateFileViewerSelectingURLs @IBAction func function015(sender: AnyObject) { //ファイルを選択 var openPanel = NSOpenPanel() openPanel.allowsMultipleSelection = false openPanel.canChooseDirectories = false openPanel.canCreateDirectories = false openPanel.canChooseFiles = true openPanel.beginWithCompletionHandler { (result) -> Void in //オープンパネルでOKを選択したら if result == NSFileHandlingPanelOKButton { //選択したファイルを let theWorkspace : NSWorkspace = NSWorkspace.sharedWorkspace() theWorkspace.activateFileViewerSelectingURLs(openPanel.URLs) }//if result }//openPanel.beginWithCompletionHandler }