目标C中的逻辑运算符和错误结果

Adr*_*lli 0 logic objective-c ios

我通过屏幕上设置的UITapGestureRecognizer获得了x和y,在获得了我找到对象触摸的位置后,所以我把条件,但不起作用.也许我把错误的条件放在目标C中?Xcode没有错误,但功能不起作用.

  -(void)tappedMapOniPad:(int)x andy:(int)y{
       NSLog(@"the x is: %d", x);
         //the x is: 302
       NSLog(@"the y is: %d", y);
         //the y is: 37

       if((121<x<=181) && (8<y<=51)){ //the error is here
            self.stand = 431;
        }else if ((181<x<=257) && (8<y<=51)){
            self.stand=430;
        }else if ((257<x<=330) && (8<y<=51)){
            self.stand = 429;
        }

      NSLog(@"The stand is %d", self.stand);
        //The stand is 431

   }
Run Code Online (Sandbox Code Playgroud)

我能怎么做?

Vik*_*ica 5

121<x<=181
Run Code Online (Sandbox Code Playgroud)

我们假设x:= 10 121<10<=181- > false<=181- > 0<=181- > true

你必须一步一步做.

((121 < x) &&  (x <=181))
Run Code Online (Sandbox Code Playgroud)

我们假设x:= 10 ((121 < 10) && (10 <=181))- > false && true- >false