Incompatible type for argument 1 of 'bezierPathWithOvalInRect' error
I have the following code:
- (void)drawRect:(NSRect)dirtyRect
{
[[NSBezierPath bezierPathWithOvalInRect:[self theRect]] stroke];
}
- (NSRect)theRect
{
return NSMakeRect(1, 1, 1, 1); // made up some values
}
When I compile it says "Incompatible type for argument 1 of 'bezierPathWithOvalInRect' error". When I do this, however, it works:开发者_开发问答
- (void)drawRect:(NSRect)dirtyRect
{
NSRect theRect = NSMakeRect(1, 1, 1, 1);
[[NSBezierPath bezierPathWithOvalInRect:theRect] stroke];
}
What is problem?
Thanks.
Did you put - (NSRect)theRect
in your header?
Also does it say your program might not respond to -theRect
?
精彩评论