title: OSX Cocoa: Error in resetting colors in two drawRect method implementations
body: <p>I have a Table subclass of NSView which contains several blocks of the Block subclass of NSView. This is the code for Table's drawRect: method:</p>
  
  <pre><code>- (void)drawRect:(NSRect)dirtyRect
  {
      [NSGraphicsContext saveGraphicsState];
      [[[NSColor whiteColor] colorWithAlphaComponent:0.6] set];
      [NSBezierPath fillRect:dirtyRect];
      [NSGraphicsContext restoreGraphicsState];
  }
  </code></pre>
  
  <p>And this the code of Block's drawRect: method:</p>
  
  <pre><code>-(void)drawRect:(NSRect)dirtyRect
  {
      [NSGraphicsContext saveGraphicsState];
      [color set];
      [NSBezierPath fillRect:dirtyRect];
      [NSGraphicsContext restoreGraphicsState];
  }
  </code></pre>
  
  <p>where "color" is set to [[NSColor whiteColor] colorWithAlphaComponent:0].</p>
  
  <p>But I don't understand why, when I run the application, evenrything's fine, but each time I click on a Block this gets filled with the classic gray initial background on Mac OS X... can anybody help? I would be very greatful, thanks. </p>