You need to do:
myplayer.volume = volumeSlider.floatValue;
The volume
property on AVPlayer
wants a float, yet in the first example you tried to assign it a value of type id
, and in the second a value of type NSString
. BTW, the expression change = @"%@", 1;
is not doing what you think it does: it assigns a string %@
(really the percent sign and an "at" sign), then evaluates the number 1 and just ignores it.