Detect when a volume is mounted on OS X
I have an OS X application that needs to respond to a volume being mounted or unmounted. I've already solved this problem by retrieving the list of volumes periodically and checking for changes, but I'd like to know if there is a better way. Register to the notification center you get from [[NSWorkspace sharedWorkspace] notificationCenter] and then process the notifications you are interested in. These are the volume related ones: NSWorkspaceDidRenameVolumeNotification , NSWorkspaceDidMountNotification , NSWorkspaceWillUnmountNotification and NSWorkspaceDidUnmountNotification . The NSWorkspace