NSBezierPath strangeness
NSBezierPath strangeness
- Subject: NSBezierPath strangeness
- From: Eric Jennings <email@hidden>
- Date: Fri, 29 Jun 2001 15:58:41 -0700
Hiya-
Has anybody else had problems with [NSBezierPath curveToPoint:::]?
The Cocoa docs show curveToPoint is indeed a selector of
NSBezierPath, and that it should take three NSPoint arguments. Any
help would be greatly appreciated.
I'm getting these errors:
Jun 29 15:51:47 DotView[19087] *** -[NSBezierPath curveToPoint:::]:
selector not recognized
Jun 29 15:51:47 DotView[19087] An uncaught exception was raised
Jun 29 15:51:47 DotView[19087] *** -[NSBezierPath curveToPoint:::]:
selector not recognized
Jun 29 15:51:47 DotView[19087] *** Uncaught exception:
<NSInvalidArgumentException> *** -[NSBezierPath curveToPoint:::]:
selector not recognized
and here's the drawRect method from the DotView example:
- (void)drawRect:(NSRect)rect {
NSRect dotRect;
NSPoint pt, pt2, pt3, pt4;
NSBezierPath *path;
path = [[NSBezierPath alloc] init];
[[NSColor whiteColor] set];
NSRectFill([self bounds]); // Equiv to [[NSBezierPath
bezierPathWithRect:[self bounds]] fill]
dotRect.origin.x = center.x - radius;
dotRect.origin.y = center.y - radius;
dotRect.size.width = 2 * radius;
dotRect.size.height = 2 * radius;
[color set];
[[NSBezierPath bezierPathWithOvalInRect:dotRect] fill];
// MY NEW CODE THAT DOESN'T WORK
pt.x =3.0;
pt.y = 3.0;
pt2.x = 30.0;
pt2.y = 30.0;
pt3.x = 0.0;
pt3.y = 0.0;
pt3.x = 0.0;
pt3.y = 0.0;
[path moveToPoint: pt];
[path curveToPoint:pt2 :pt3 :pt4];
[path stroke];
[path release];
}
TIA-
Eric
email@hidden