0

我有以下代码:

- (void)drawRect:(NSRect)dirtyRect 
{
   [[NSBezierPath bezierPathWithOvalInRect:[self theRect]] stroke];
}

- (NSRect)theRect
{
   return NSMakeRect(1, 1, 1, 1); // made up some values
}

当我编译时,它显示“'bezierPathWithOvalInRect' 错误的参数 1 的类型不兼容”。但是,当我这样做时,它会起作用:

- (void)drawRect:(NSRect)dirtyRect 
{
   NSRect theRect = NSMakeRect(1, 1, 1, 1);
   [[NSBezierPath bezierPathWithOvalInRect:theRect] stroke];
}

什么是问题?

谢谢。

4

1 回答 1

2

你把- (NSRect)theRect你的标题?

它还说您的程序可能没有响应-theRect吗?

于 2010-02-05T21:17:47.003 回答