Hi I have tried multiple things combining knowledge of mine and the internet but I cannot find a way to check if an NSInteger is between 10 and 20.

Would it be something like this? (it didn't work)

if (FXVolumeSlider.value == 10-20) {}

Thanks in advance

有帮助吗?

解决方案

Inclusive...

if (FXVolumeSlider.value >= 10 && FXVolumeSlider.value <= 20) {}

Exclusive...

if (FXVolumeSlider.value > 10 && FXVolumeSlider.value < 20) {}

其他提示

try this:

 if(FXVolumeSlider.value>=10 &&  FXVolumeSlider.value<=20)
{

  //your stuff
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top