Hello!
going through my book's examples i see this bit of code:
Works as it should, but i dont understand the last bit of
I have tested it with:
NSLog(@"slider value is: %d",(int)slider.value);
and it seems to be giving me the correct answer everytime, can someone tell me if that "+ 0.5f" is really needed? or do you use the slider the way i used it in my NSLog call?
°°
going through my book's examples i see this bit of code:
-(IBAction)sliderChanged: (id)sender
{
UISlider *slider = (UISlider *)sender;
int progressAsInt = (int)(slider.value + 0.5f);
Works as it should, but i dont understand the last bit of
+ 0.5f
I have tested it with:
NSLog(@"slider value is: %d",(int)slider.value);
and it seems to be giving me the correct answer everytime, can someone tell me if that "+ 0.5f" is really needed? or do you use the slider the way i used it in my NSLog call?
°°