unmountAndEjectDeviceAtURL
URLで指定したデバイスをアンマウントします
- (BOOL)unmountAndEjectDeviceAtURL:(NSURL *)url error:(NSError **)errorfunc unmountAndEjectDeviceAtURL(_ url: NSURL, error error: NSErrorPointer) -> Bool
解説
URLで指定したデバイスをアンマウントします。
返り値
BOOL
Bool
引数
(NSURL *)url_ url: NSURL
(NSError **)errorerror: NSErrorPointer
フレームワーク
ApplicationKit
クラス
NSWorkspace
使用可能
10.6
更新時のバージョン
OS X 10.10.3
Swift1.2
参照
関連記事(外部サイト)
例文
//NSWorkspace unmountAndEjectDeviceAtURL func buttonAction034(sender: AnyObject){ let theWorkspace : NSWorkspace = NSWorkspace.sharedWorkspace() let theURL : NSURL = NSURL(fileURLWithPath: "/Volumes/ディスクイメージ")! var theError : NSError? = NSError() let result : Bool = theWorkspace.unmountAndEjectDeviceAtURL(theURL, error: &theError) if result { NSLog("OK") }else{ NSLog("NG %@",(theError?.description as String?)!) NSLog("NG %d",(theError?.code as Int?)! ) NSLog("NG %@",(theError?.domain as String?)! ) } }