简体   繁体   English

滑块使我的应用崩溃

[英]Slider makes my app crashes ios

I was trying to implement a slider in my app, I put a slider on the storyboard and when I run the app and try to slide it app crashes with the following error: 我试图在我的应用中实现一个滑块,将一个滑块放在情节提要上,当我运行该应用并尝试对其滑动时,应用崩溃,并出现以下错误:

Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ffee7a28ff8)

I searched on the web and this error is related to a function called infinite times without exiting from its calling loop. 我在网上搜索了此错误,该错误与一个称为无限次数的函数有关,而没有退出其调用循环。 The problem is that I haven't even connected my slider to code, so it doesn't call any function! 问题是我什至没有将滑块连接到代码,因此它不调用任何函数! So, what's wrong with this damn slider? 那么,该死的滑块有什么问题呢?

EDIT: here is a screen Screen 编辑:这是一个屏幕屏幕

Create an outlet for slider object, 为滑块对象创建一个出口,

@property (weak, nonatomic) IBOutlet UISlider * slider;

then give an action 然后采取行动

- (IBAction)sliderValueChanged:(id)sender
{
    // write the code that you want to perform after moving the slider
}

try this code 试试这个代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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