0
votes

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

3
are you calling setPopUpViewCornerRadius() from anywhere? - Rajesh
@iDev Did you read the code? It's the 2nd line. - rmaddy
@iDev Yes, i'm using custom slider - Vaibhav Jhaveri
@VNJ You are not using a custom slider. The error clearly indicates you are using UISlider. Perhaps you need to specify the actual class name in Interface Builder. - rmaddy

3 Answers

1
votes

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;
0
votes

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 enter image description here

http://cocoadocs.org/docsets/ASValueTrackingSlider/0.9.2/Classes/ASValueTrackingSlider.html refer the link.

0
votes

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