- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil];
}
- (void)volumeChanged:(NSNotification *)notification{
float volume = [[[notification userInfo] objectForKey:@"AVSystemController_AudioVolumeNotificationParameter"] floatValue];
//[self innerSetVolume:volume];
}
volumeChanged не будет вызываться при нажатии аппаратной кнопки громкости вверх / вниз на устройстве.
кто-нибудь встречал вопрос раньше?
PS: мое тестовое устройство - iPod touch с iOS 4.3, а не iPhone.