CGPoint locationInView question

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

  1. macrumors newbie

    Joined:
    Apr 4, 2008
    #1
    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

    Buschmaster

    Joined:
    Feb 12, 2006
    Location:
    Minnesota
    #2
    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

    kainjow

    Joined:
    Jun 15, 2000
    #3
    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

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

    Thanks
     

Share This Page