change NSSlider Value programmatically
-
26-05-2021 - |
Question
Is there a way to make an IBOutlet of an NSSlider and then be able to change its value programmatically? slider.value =
...does not work.
Thanks!
Solution
You can use the methods of NSControl.
Example:
[self.slider setDoubleValue:0.1];
OTHER TIPS
Swift answer to this question is to use the doubleValue property to access the slider value in OSX:
slider.doubleValue = 0.1
print(slider.doubleValue)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow