I am using Xcode 4.3 and I want to be able to edit the value of a UISlider using a UITextField. How can I do this? I have a slider that displays its value in a text field, but can I also set the slider's value from a text field?
Thanks for the help!!
Assuming "textField" is the name of your text field, I would add a target to it in your viewDidLoad method:
[textField addTarget:self
action:@selector(textFieldDidChange)
forControlEvents:UIControlEventEditingChanged];
And then handle the change like you said:
- (void)textFieldDidChange {
Slider.value = [[textfield.text] intValue];
}
Hope this helps.