I am trying to execute a method when the user presses the volume button but the "volumeChanged" line does not appear in the logs. I looked at several examples
iPhone Detect Volume Keys press.
-(void)volumeChanged{
//do something
NSLog(@"volumeChanged");
}
- (void)viewDidLoad {
[super viewDidLoad];
masterViewController = self;
[masterViewController swipeInit];
[masterViewController intervalPickerInit];
// init audio session
AudioSessionInitialize(NULL, NULL, NULL, NULL);
AudioSessionSetActive(true);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(volumeChanged:)
name:@"AVSystemController_SystemVolumeDidChangeNotification"
object:nil];