Fire notifications once USB device is connected to MAC
I am very new to Macintosh Application Development. I have a question that, is it possible to open my application when user connects a USB device to the Macintosh? I am very curious on this. Beca开发者_C百科use I have a device and when I connect it to MAC system I need to open my application installed in the app and get the data from the USB device. Is this possible?
If it's just a storage device with a mountable file system, use NSWorkspace's NSWorkspaceDidMountNotification/NSWorkspaceWillUnmountNotification/NSWorkspaceDidUnmountNotification notifications to listen for it.
If you're looking for any other type of device, you'll have to dive a lot deeper. Check out the USB Device Interface Guide.
精彩评论