-5

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

OnkaPlonka
  • 1,232
  • 10
  • 19
  • I'm sad this is closed. I was hoping there was a one-method solution like `[FXVolumeSlider.value isBetween:10 and:20]`. Cocoa has these cool shortcuts sprinkled all around, after all. – Ky - Jul 14 '15 at 22:02

2 Answers2

5

Inclusive...

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

Exclusive...

if (FXVolumeSlider.value > 10 && FXVolumeSlider.value < 20) {}
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
1

try this:

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

  //your stuff
}
Satish Azad
  • 2,302
  • 1
  • 16
  • 35