4

I'm trying to make an application that uses the event's when the volume up/down buttons are pressed. I'm using the event like this:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(volumeChanged:) 
                                             name:@"AVSystemController_SystemVolumeDidChangeNotification" 
                                           object:nil];

when one of the volume button is pressed, the function "volumeChanged:" is called.

my problem is that when one of the volume buttons is pressed, I also get the default notification that shows the current volume bar status. I want to hide this message, so nothing will appear when I press the volume buttons. is anyone know how to do so?

p.s. I don't care about the volume itself. all I care about is the buttons events and the message that pops out when one of them is pressed.

thanks.

this notification

Havivi
  • 81
  • 1
  • 7

1 Answers1

1

Edit:
Now I understand. Check out this answer and its comments.

Documentation is your friend, take a look at MPVolumeView class reference.
As of 4.2 you can manage visibility of controls with two new properties: showsVolumeSlider and showsRouteButton.

P.S. Welcome to StackOverflow :) Remember to use search box and accept answers that solved your problems ;)

Community
  • 1
  • 1
matm
  • 7,059
  • 5
  • 36
  • 50
  • maybe i wasn't clear. the message that I want to hide isn't a control. it's the message that will appear also when you in the menu of the iphone and pressing the volume buttons. the message says "ringer", show a picture of a speaker, and shows the volume of the iphone below. it's the default message that every one in every app get when they press the volume button. I want to hide this message, if it's possible of course. :) – Havivi May 08 '12 at 11:38
  • this isn't my case, because I don't use the MPVolumeView control. I changing the volume throw the buttons of the iphone (or throw the headphones), so it's don't work for me. maybe I should add a picture. – Havivi May 08 '12 at 12:12