I use several UISliders in the form and I only need one method to track slider changes.
Now I have a method:
- (IBAction) slider1ValueChanged:(UISlider *)sender {
somelabel.text = [NSString stringWithFormat:@" %.1f", [sender value]];
}
But since I use several sliders, I want to use the switch statement to run for a specific slider, for example, if I have 2 sliders, and both of them use the above ValueChanged method, I need something like:
- (IBAction) slider1ValueChanged:(UISlider *)sender {
switch(SLIDERID)
case SLIDER1:
blabla;
break;
case SLIDER2:
update other label;
break;
case default:
break;
somelabel.text = [NSString stringWithFormat:@" %.1f", [sender value]];
}
Who can help me?
Thanks in advance!
source
share