Instance Method

unmountVolumeAtURL:options:completionHandler:

Starts the process of unmounting the specified volume.

Declaration

- (void)unmountVolumeAtURL:(NSURL *)url options:(NSFileManagerUnmountOptions)mask completionHandler:(void (^)(NSError *errorOrNil))completionHandler;

Parameters

url

A file URL specifying the volume to be unmounted.

mask

A bitmask of NSFileManagerUnmountOptions that you can use to customize the unmount operation’s behavior.

completionHandler

A block executed when the unmount operation completes. The block receives an NSError parameter which is nil if unmounting was successful. Otherwise, it indicates why unmounting failed.

Discussion

If the volume is encrypted, it is relocked after being unmounted.

See Also

Unmounting Volumes

NSFileManagerUnmountOptions

Options that specify the behavior of an unmount operation.

NSFileManagerUnmountDissentingProcessIdentifierErrorKey

The process identifier of the process that prevented a volume from unmounting.