简体   繁体   中英

crash when loading the View

I have a button named settings , when I press this button the application crashes.

I have doubt in warnings that's why I'm going to show you what I got when building:

 .../RechercherViewController.m:66: warning: 'UISlider' may not respond to '-setShowValue:'

that warning is pointing me at this line in the viewDidLoad method:

[rayonDeRechercheSlider setShowValue:YES];

rayonDeRechercheSlider is a UISlider declared in the .h file of the View :

IBOutlet UISlider *rayonDeRechercheSlider;

UISlider does not use a boolean property called showValue and also UISlider does not offer any explicit method called setShowValue: , hence the method call: setShowValue:YES on a UISlider will crash the app.

You may want to call [rayonDeRechercheSlider setValue:1.0 animated:YES] (replace 1.0 with the value you intend to set.

After a little further research of where you might have gotten the idea of setShowValue: being a valid selector. I ran across this custom class called UISliderControl

Maybe this is what you are looking for?

EDIT:

More Info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM