URLForApplicationWithBundleIdentifier:
バンドルIDからURLを返します。
- (NSURL *)URLForApplicationWithBundleIdentifier:(NSString *)bundleIdentifier
func URLForApplicationWithBundleIdentifier(_ bundleIdentifier: String) -> NSURL?
解説
バンドルIDからURLを返します。
返り値
NSURL *NSURL?
引数
(NSString *)bundleIdentifier_ bundleIdentifier: String
フレームワーク
ApplicationKit
クラス
NSWorkspace
使用可能
10.6-
更新時のバージョン
OS X 10.10.3
Swift1.2
参照
関連記事(外部サイト)
例文
//NSWorkspace URLForApplicationWithBundleIdentifier @IBAction func function022(sender: AnyObject) { let theWorkspace : NSWorkspace = NSWorkspace.sharedWorkspace() let theURL : NSURL = theWorkspace.URLForApplicationWithBundleIdentifier("com.apple.safari")! NSLog("%@", theURL.description) //file:///Applications/Safari.app/ }