Link address :http://blog.csdn.net/diyagoanyhacker/article/details/6582806
MPMusicPlayerController *ipodMusicPlayer = [MPMusicPlayerController iPodMusicPlayer];
[ipodMusicPlayer beginGeneratingPlaybackNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(trackTheDeviceVolume:)
name:MPMusicPlayerControllerVolumeDidChangeNotification
object:nil];