UISlider's value is not shown by UILabel
In my app, I have a Settings view, where the user can use UISlider to set value from 50 to 1000. The selected value is then shown in a UILabel.
The problem is that the label does not display at all. The Action and the IBOutlets are connected in IB. The NSLog displays the value correctly on the console.
I can't figure out what is going on....help is needed :)
I have the following:
IBOutlet UILabel *sliderLabel;
IBOutlet UISlider *slider;
...
@property (nonatomic, retain) UILabel *sliderLabel;
@property (nonatomic, retain) UISlider *slider;
-(IBAction) sliderValueChanged:(id) sender;
and
@synthesize sliderlabel, slider;
- (IBAction) sliderValueChanged:(UISlider *) sen开发者_StackOverflowder {
NSString *sliderValue = [NSString stringWithFormat:@"%d feet",(int)[sender value]];
NSLog(@"%@", sliderValue);
[[self sliderLabel] setText: sliderValue];
}
Thanks, and regards.
精彩评论