How to detect something in headphone jack on a Mac?
问题 Is there a way to detect if something is plugged into the headphone jack of a Mac using c or objective-c ? Thanks 回答1: Should you still want to dive in and mess with this deep magic I was able to construct something together form the code I found here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/54013-hardware-volume-change-listener-callback.html You want to register a listen to the AudioProperties and catch any messages about 'kAudioSessionProperty_AudioRouteChange'. Using the