Reputation: 1605
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UISlider setPopUpViewCornerRadius:]: unrecognized selector sent to instance 0xa44bef0'
Code:
self.slider1.maximumValue = 255.0;
self.slider1.popUpViewCornerRadius = 25.0;
[self.slider1 setMaxFractionDigitsDisplayed:0];
self.slider1.popUpViewColor = [UIColor colorWithHue:0.55 saturation:0.8 brightness:0.9 alpha:0.7];
self.slider1.font = [UIFont fontWithName:@"GillSans-Bold" size:22];
self.slider1.textColor = [UIColor colorWithHue:0.55 saturation:1.0 brightness:0.5 alpha:1];
Please guide me, Thanks in Advance
Upvotes: 0
Views: 627
Reputation: 2124
UiSlider does not have this property of
popUpViewCornerRadius
Either remove this line else this property would be included in the Custom class.
So change the UISlider *slider1
to ASValueTrackingSlider *slider1
Upvotes: 0
Reputation: 10434
When you are allocating self.slider you need to use ASValueTrackingSlider
instead of UISlider
.
if you are using story board or xib you need to give ASValueTrackingSlider
in identity inspector. like
http://cocoadocs.org/docsets/ASValueTrackingSlider/0.9.2/Classes/ASValueTrackingSlider.html refer the link.
Upvotes: 0
Reputation: 30488
UISlider doesn't have this property popUpViewCornerRadius
, because of that this error is occurring. You will need to remove this below line.
self.slider1.popUpViewCornerRadius = 25.0;
Upvotes: 1