views:

221

answers:

1

hi, i'm using the code of this link: http://blog.stormyprods.com/2008/09/proper-usage-of-mpvolumeview-class.html it is working on an ipod touch, but NOT on iphones. what can be the reason for that?

A: 

Two things:

  1. I think iPhone OS 3.0 does a better job of syncing the MPVolumeView slider with changes to the system volume received from the buttons on side. So the workaround on that blog (listening for NSNotifications) may no longer be necessary.
  2. On the iPhone, volume changes are contextual. If your app is currently playing sound, then hitting the volume buttons (or, presumably, MPVolumeView) affects the volume level of your app's audio. But if your app isn't producing sound, then you are just changing the ringer volume. This might explain why your current code works on touches, which don't have ringers.
invalidname