I have implemented a custom class of UISlider so the touchable areas are larger
Everything is working great except now I want to change the initial values depending on other factors in the app.
The only code I have gets the slider’s ID from (sender)
I need to address the slider like so…
slider.value = 25.0;
But the only code I have is
-(IBAction) slider1Changed:(id) sender{
UISlider *slider = (UISlider *) sender;
int progressAsInt =(int)(slider.value);
NSLog(@"Slider is %@",slider);
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setInteger:progressAsInt forKey:@"SharedSkilledWorkforce"];
}
In the xib @property (nonatomic, retain) UISlider *slider1; doesn’t show up as a conncetion
How do I address the custom UISlider?
Have you tried adding IBOutlet to your slider1 property?
This:
Needs to be:
in order to show up in IB. IBOutlet is a hint to the designer similar to IBAction.