On 28/11/2009, at 7:46 AM, Shane wrote:

> I don't know how large my NSPointArray size needs to be so I'd like to
> know how I would dynamically allocate NSPoints to populate an
> NSPointArray? I think I can do it with NSMutableArray, but
> NSBezierPath takes an NSPointArray (which is what my end result is for
> the points) and it just seems cleaner and more efficient if I can stay
> with that instead of converting between point arrays and mutable
> arrays.


Why not just accumulate the points directly into NSBezierPath? It can be 
thought of as an array of points in a sense. Unless there's a compelling need 
to have the points themselves available in addition to the bezier path, just 
cut out the middle man (and it's not difficult to retrieve the points from a 
bezier path in any case).

Use [path lineToPoint:] to append a new point, and [path moveToPoint:] for the 
first point.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to