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)
我能怎么做?
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
| 归档时间: |
|
| 查看次数: |
490 次 |
| 最近记录: |