1

I am developing a simple music player in xcode and want to try using stepper instead of slider for volume.I have tried using 'valuechanged' and passing it to volume but in vain.

-(void)adjustVolume
{
    if (audioPlayer != nil)
    {
         audioPlayer.volume = volumeControl.value;//volume control is (IBAction) for stepper
    }
} 

help.Thanks

Baby Groot
  • 4,637
  • 39
  • 52
  • 71
Madhur Sodhi
  • 121
  • 1
  • 9

1 Answers1

0

For that you have try this , i don't check this code exactly :

  audioPlayer.volume= ourStepper.value;

and UIStepper changevalue for this method:

- (IBAction)stepperValueChanged:(id)sender
{
     double stepperValue = ourStepper.value;
     audioPlayer.volume= stepperValue;
}

For more detail for UIStepper:

UIStepper-tutorial

How to used UIStepper?

UIStepper Changevalue Snippet

Community
  • 1
  • 1
Dhaval Bhadania
  • 3,090
  • 1
  • 20
  • 35
  • in ViewDidLoad method, the Xcode intelligence will not show volume as an object of AVPlayer and display error:-'Property volume not found as an object of AVPlayer' – Madhur Sodhi Nov 20 '13 at 07:55