Re: NSBezierPath setLineDash:count:phase:
Re: NSBezierPath setLineDash:count:phase:
- Subject: Re: NSBezierPath setLineDash:count:phase:
- From: Shawn Erickson <email@hidden>
- Date: Fri, 1 Aug 2003 14:51:03 -0700
On Friday, August 1, 2003, at 02:25 PM, David Elliott wrote:
Hi,
Does NSBezierPath make a copy of the (const float *) pattern parameter
or should I write my code such that the array stays around for as long
as the NSBezierPath does?
Defensive programming tells me I probably should keep it around if
there's even a question, but I'd rather not waste cycles (mine, who
cares about the computer :-) if someone can say for sure that it's
supposed to make a copy. Furthermore, what happens if the NSBezierPath
itself is copied?
The Apple documentation for that method does not say one way or
another which should be corrected. I strongly suspect it is designed
to take a pointer to a statically initialized array or at least one
that's guaranteed good for the life of the object.
It would be easy to test by setting up a path and twiddling a value in
the array after setup (I imagine it makes a copy). It might make sense
for you to file a documentation defect, it would be nice for the docs
to outline what is expected.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.