• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: structs in Mutable containers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: structs in Mutable containers


  • Subject: Re: structs in Mutable containers
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 16 Sep 2008 10:49:46 -0400
  • Organization: Rogue Research

On 9/16/08 8:24 PM, Graham Cox said:

>CGPoints and NSPoints have the same structure so you can
>cast one to t'other.

You shouldn't really.  You should use NSPointFromCGPoint/
NSPointToCGPoint.  Their implementation is in NSGeometry.h and is not a
simple cast.

NSPoint and CGPoint may be the same now, but they may not always be.
(Consider that NSAffineTransformStruct and vImage_AffineTransform were
the same, but the former changed from float to CGFloat and the latter
stayed float, even in 64 bit.)

Also, they are separate structs to the compiler, so it is free (though
unlikely) to align and pack them differently.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: structs in Mutable containers
      • From: "Clark Cox" <email@hidden>
References: 
 >structs in Mutable containers (From: "Christian Giordano" <email@hidden>)
 >Re: structs in Mutable containers (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: async NSOperation and NSOperationQueue
  • Next by Date: Re: async NSOperation and NSOperationQueue
  • Previous by thread: Re: structs in Mutable containers
  • Next by thread: Re: structs in Mutable containers
  • Index(es):
    • Date
    • Thread