Frage

This is a strange bug I'm experiencing when testing on an old iPod. I'm trying to get location values on touchesMoved, but the y always outputs value equal to x. If I log using NSStringFromCGPoint, then I get the correct output. How come accessing x and y separately is not working?

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
War es hilfreich?

Lösung

It appears the problem didn't haven't anything to do with CGPoint but rather with the plist parameters.

This question solved my issue.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top