A simple project to show you how to use CoreAudio in order to detect headphone insertion/removal.
When headphones are inserted or the internal speakers are selected for use, your notification block will be called.
All Kudos go to this guy on SO.
This has only been tested on OS X 10.9, but it builds without warnings using the 10.7 SDK - so it should work fine there.
This work is provided under the LGPL license. That is - any derivatives of this work, or apps that use this source code must also be open source (any license)