Slider Not Behaving As I Would Expect
- by Adam Waite
I have a slider that changes a float from 1 to 10 but I want to save this value and use it across all view controllers so I have saved that float as an NSNumber in a model class (settingsData.sensitivitySliderSettingValue).
I am trying to output the updated slider value to the console every time that it is changed however it just gets set to 0 rather than 0 to 10. I don't understand why this is...
Here's my code:
-(IBAction)sensitivitySliderValueChanged:(id)sender
{
[self updateSensitivity];
}
-(void)updateSensitivity{
settingsData.sensitivitySettingValue = [NSNumber numberWithFloat:sensitivitySlider.value];
NSLog(@"The Slider Value is: %1.1f", [settingsData.sensitivitySettingValue floatValue]);
}