【发布时间】:2010-10-24 12:53:19
【问题描述】:
当我在 Xcode 中“构建和分析”此代码时,我收到一个我不理解的警告。这是有问题的方法:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch * touch = [touches anyObject];
CGPoint location = [touch locationInView:self];
CGPoint relativePosition = CGPointMake(1.0-(location.x / self.bounds.size.width),location.y / self.bounds.size.height);
[[Stage getSharedStage] movePartToLocation:relativePosition];
}
这是警告:
warning: The left operand of '/' is a garbage value
CGPoint relativePosition = CGPointMake(1.0-(location.x / self.bounds.size.width),location.y / self.bounds.size.height);
~~~~~~~~~~ ^
1 warning generated.
以下是箭头:
它想告诉我什么?代码运行良好。
【问题讨论】:
-
请粘贴一张图片,显示箭头如何指向那里。
标签: objective-c cocoa-touch xcode ios