title: Change the font, font color and background color of an NSTableView at runtime using NSFontPanel?
body: <p>I'd like to enable the user to change the font of an view-based <code>NSTableView</code>. I'm using Cocoa bindings and Core Data. In my test code, I do have a <code>changeFont:</code> method that does get called as soon as I press a font-related key combination, like <code>cmd-I</code> or <code>cmd-B</code>, but I've had no luck so far in changing the actual font of the table view:</p>
  
  <pre><code>- (void)changeFont:(id)sender
  {
      NSFont *oldFont = [self.airportTableView font];
      NSFont *newFont = [sender convertFont:oldFont];
      NSLog(@"sender: %@ oldfont: %@, newFont: %@ fontmanager selected: %@, font panel selected: %@",
               sender, oldFont, newFont, [sender selectedFont], [sender convertFont:[sender selectedFont]]);
      [self.airportTableView setFont:newFont];
  }
  </code></pre>
  
  <p>produces the following output:</p>
  
  <pre><code>sender: &lt;NSFontManager: 0x6080000b4580&gt; oldfont: (null), newFont: (null) fontmanager selected: (null), font panel selected: (null)
  </code></pre>
  
  <p>Even this trivial code:</p>
  
  <pre><code>font = [NSFont boldSystemFontOfSize:12];
  [self.airportTableView setFont:font];
  NSFont *oldFont = [self.airportTableView font];
  NSLog(@"oldfont: %@",oldFont);
  </code></pre>
  
  <p>only results in:</p>
  
  <pre><code>oldfont: (null)
  </code></pre>
  
  <p>Can any kind soul provide some code that allows the user to change the font of an NSTableView?</p>