I’m trying to read out the value of…

- by

I’m trying to read out the value of a UISlider and put it into a UIProgressView. Not a problem, all I need is to divide my UISlider.value by 100 to get the correct output. So far so good.

However, for some reason this statement does not work. I don’t know why:

    self.progressValue.progress = [[self.mySlider.value]/100];

Doesn’t make sense. All I’m doing is dividing the self.mySlider.value by 100, giving me the value that I need. If I do it by passing this value into a variable which I divide by 100 it works perfectly fine:

    float myValue = self.mySlider.value;
    myValue = myValue / 100;
    self.progressValue.progress = myValue;



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.