PDA

View Full Version : CGPoint locationInView question




mbpc2d.user
Apr 13, 2008, 11:36 PM
I am getting the CGPoint from locationInView, and I can't figure out the numbers its producing. They are HUGE (around 1,000,000,000). Are they supposed to be that big, or did I forget something?



Buschmaster
Apr 14, 2008, 08:23 AM
If you try and use CGPoint strictly as a string the numbers will be huge and from what I can tell it's more of just a code than an actual point.

However, if you're trying to use something like CGRectMake where you need a specific x and y, you can use point.x and point.y assuming CGPoint point;

Does that make sense?

kainjow
Apr 14, 2008, 08:26 AM
If you're using something like NSLog to check the values, make sure you use %f instead of %d/%i because the x and y values are floats, not integers.

mbpc2d.user
Apr 14, 2008, 03:00 PM
If you're using something like NSLog to check the values, make sure you use %f instead of %d/%i because the x and y values are floats, not integers.

yeah, that was my problem. I wasn't expecting %d to automatically assume unsigned, although thats what I thought was happening.

Thanks