【发布时间】:2013-08-01 17:45:32
【问题描述】:
我在UIView 类中声明了一个CGPoint,在我的viewController 中我尝试检查CGPoint 是否不等于CGPointZero,但我收到此错误:Invalid operands to binary expression ('CGPoint' (aka 'struct CGPoint') and 'CGPoint')
这是 if 语句:
if (joystick.velocity != CGPointZero)
错误指向!=,我不知道为什么它给我一个错误。
joystick 是 UIView 类,CGPoint velocity 声明如下:
@property(nonatomic) CGPoint velocity;
【问题讨论】:
标签: ios if-statement cgpoint