You are registering it for all events. Make it for your event only like
[slider addTarget: self action: @selector(sliderChanged:event:) forControlEvents: UIControlEventTouchDragInside];
Question
When releasing the touch on a UISlider the value of the slider changes slightly and uncontrollably. It's so sensitive that it even changes when just releasing the finger from the screen. How can I achieve that the user can set a value he wants without problems?
That's how I create my UISlider:
UISlider *slider = [[UISlider alloc] initWithFrame: CGRectMake(100.0, 100.0, 200.0, 40.0)];
slider.minimumValue = 0.0;
slider.maximumValue = 100.0;
[slider addTarget: self action: @selector(sliderChanged:event:) forControlEvents:UIControlEventAllEvents];
[slider setValue: 50.0 animated: NO];
La solution
You are registering it for all events. Make it for your event only like
[slider addTarget: self action: @selector(sliderChanged:event:) forControlEvents: UIControlEventTouchDragInside];
Autres conseils
Try changing it to this instead:
[slider addTarget: self action: @selector(sliderChanged:event:) forControlEvents: UIControlEventValueChanged];
And if all you want is to trigger the target only when the finger is lifted, try setting continuous
property of the UISlider
to NO
.