CGPoint locationInView question

Discussion in 'Mac Programming' started by mbpc2d.user, Apr 13, 2008.

  1. macrumors newbie

    Apr 4, 2008
    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?
  2. macrumors 65816


    Feb 12, 2006
    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?
  3. Moderator emeritus


    Jun 15, 2000
    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.
  4. thread starter macrumors newbie

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


Share This Page