Re: CGPoint wrapper?
Re: CGPoint wrapper?
- Subject: Re: CGPoint wrapper?
- From: Graff <email@hidden>
- Date: Thu, 23 Oct 2008 00:09:23 -0400
On Oct 22, 2008, at 5:49 PM, DKJ wrote:
Is there some straightforward way of wrapping a CGPoint so I can put
it in an NSArray? I don't want to use a C array because I want to have
fast enumeration available. Or should I just write a simple NSPoint -
CGPoint conversion method?
NSPoint and CGPoint are structs that are essentially the same. You
can convert between them with a simple cast:
NSPoint point = *(NSPoint *)&myCGPoint;
<http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/QuartzOpenGL/chapter_10_section_2.html
>
You can also use the function NSPointFromCGPoint() which does the
exact same thing for you:
NSPoint point = NSPointFromCGPoint(myCGPoint);
(Declared in NSGeometry.h)
- Graff
_______________________________________________
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