I’m trying to read out the value of…

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;





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.