Why can I only see the "y" component of nowPoint changing, ["x" compone开发者_StackOverflow中文版nt is always "0"] ??
- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event {
[super touchesMoved:touches withEvent:event];
CGPoint nowPoint = [[touches anyObject] locationInView:self.view];
CGPoint prevPoint = [[touches anyObject] previousLocationInView:self.view];
NSLog(@"x %d, y %d", nowPoint.x, nowPoint.y);
}
NSLog(@"x %d, y %d", nowPoint.x, nowPoint.y);
Change this to...
NSLog(@"x %0.02f, y %0.02f", nowPoint.x, nowPoint.y);
精彩评论