我有以下法典,在ool之后,我想补充一下我的想法。 这里是我所持有的法典,但出于某种原因,它不是设置ool子,也不是称呼 set。 我要适当提及其他类别? 感谢
页: 1 页: 1
-(IBAction)colorToggle:(id)sender
{
if ([colorFilter state] == NSOnState)
{
CutoutView *theView = [[CutoutView alloc] init];
[theView setFilterEnabled:YES];
iii
iii
//in cutoutView.m
- (void)drawRect:(NSRect)dirtyRect
{
[[[NSColor blackColor]colorWithAlphaComponent:0.9]set];
NSRectFill(dirtyRect);
//this is what i want to be drawn when my bool is true and update the drawRect
if (filterEnabled == YES) {
NSRectFillUsingOperation(NSMakeRect(100, 100, 300, 300), NSCompositeClear);
[self update];
iii
iii
-(void)update
{
[self setNeedsDisplay:YES];
iii