0

这是我在旧 iPod 上测试时遇到的一个奇怪错误。我试图在 touchesMoved 上获取位置值,但 y 总是输出等于 x 的值。如果我使用 NSStringFromCGPoint 登录,那么我会得到正确的输出。为什么单独访问 x 和 y 不起作用?

CGPoint location = [singleTouch locationInView:self.view];
NSLog(@"Location using NSStringFromCGPoint %@", NSStringFromCGPoint(location)); // output: {27, 136}
NSLog(@"Location using x and y %f %f",location.x, location.y); // output: 27, 27
4

1 回答 1

0

看来问题与 CGPoint 没有任何关系,而是与 plist 参数有关。

这个问题解决了我的问题。

于 2012-01-29T14:18:46.463 回答