Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我喜欢用 UISlider 设置定时器的间隔。我已经将值和值作为字符串,现在我必须将值分配给计时器。有人可以帮帮我吗?
slidervaluefortimer = [NSString stringWithFormat:@"%f",slider.value];
您只需使用 slider.value 作为此方法的参数:
NSTimer *aTimer = [NSTimer scheduledTimerWithTimeInterval:slider.value target:self selector:@selector(myMethod:) userInfo:nil repeats:NO];