Am 02.04.2008 um 01:05 schrieb Graham Cox:
As I said, it says nothing about how it's implemented. Chances are,
it will avoid creation of an unnecessary NSBezierPath object, but
relying on that being the case is folly.
On 2 Apr 2008, at 2:23 am, Matthew Whillock wrote:
The class reference
On 1 Apr 2008, at 14:40, Leslie Smith wrote:
I'm sure I'm missing something.
Yes. An understanding of Autorelease pools (and presumably Cocoa
memory management in general)
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
The unoptimal way to fix your
Hi:
I have a Cocoa application which draws a (very) large number of line
segments using the code below in a loop, in drawRect, in a subclass
of NSView.
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom] ;
[p1 lineToPoint: linetop] ;
[p1 stroke] ;
(These are the outputs from a
Blimey! I went to (most) of your lectures! Networks I think it was.
Software Engineerng MSc 1985/6 or thereabouts...
Anyway, have you considered using +strokeLineFromPoint:toPoint:
instead? No need for an NSBezierPath instance.
Cheers,
Matt
(Ok then, some of your lectures)
Hi:
I have a
Are you sure? This could be just a convenient interface for creating a
bezier object with the points passed, stroking it and releasing or
autoreleasing it. The docs say nothing about how it's implemented.
A better idea might be to create ONE bezier object at the top of the
loop, collect
Le 1 avr. 08 à 14:50, Matt Gough a écrit :
On 1 Apr 2008, at 14:40, Leslie Smith wrote:
I'm sure I'm missing something.
Yes. An understanding of Autorelease pools (and presumably Cocoa
memory management in general)
On 1 Apr 2008, at 11:40 pm, Leslie Smith wrote:
Hi:
I have a Cocoa application which draws a (very) large number of line
segments using the code below in a loop, in drawRect, in a subclass
of NSView.
p1 = [NSBezierPath bezierPath] ;
[p1 moveToPoint: linebottom] ;
[p1 lineToPoint:
Hi Leslie,
NSView does not store any drawing. If the code bellow
is
executed in the loop as you are indicating and
possibly several thousand times, each time through the
loop you are creating a new autoreleased NSBezierPath.
If this is the case, you should include
NSAutoreleasePool and drain or
The class reference has this to say about it:
Strokes a line between two points using the current stroke color and
the default drawing attributes.
+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2
So it will just draw a line.
Cheers,
Matt
Are you sure? This could be