问题
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!
回答1:
You can use the methods of NSControl.
Example:
[self.slider setDoubleValue:0.1];
回答2:
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)
来源:https://stackoverflow.com/questions/9867343/change-nsslider-value-programmatically