title: Custom columnAutoresizingStyle with NSTableView
body: <p>I like to implement my own column resizing scheme in an <code>NSTableView</code>. I got this mostly working, but struggle with the dynamic appearance of the vertical scrollbar.</p>
  
  <p>Imagine I want to have a table with two columns, in which the first is always occupying 1/3 and the other the remaining 2/3 of the visible space.</p>
  
  <p>I've tried to accomplish this by implementing the <code>tile</code> method in a subclass of <code>NSTableView</code> as follows:</p>
  
  <pre><code>- (void)tile
  {
      NSClipView *container = (NSClipView*) self.superview;
  
      NSSize spacing = self.intercellSpacing;
      CGFloat avail = container.frame.size.width;
      CGFloat cw0 = (int) (avail / 3);
      CGFloat cw1 = avail - cw0;
      self.tableColumns[0].width = cw0 - spacing.width;
      self.tableColumns[1].width = cw1 - spacing.width;
  
      [super tile];
  }
  </code></pre>
  
  <p>I believe I have to invoke <code>[super tile]</code> to have the scrollbars get added as necessary.</p>
  
  <p>The problem, however, is that when I resize the window (and thereby also resizing the TableView), the horizontal scrollbar is sometimes part of the clip view and sometimes isn't, leading to flickering.</p>
  
  <p>Here are examples that I get when resizing the window:</p>
  
  <p>Good outcome:</p>
  
  <p><a href="https://i.stack.imgur.com/NlVq9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NlVq9.png" alt="good resize example"></a></p>
  
  <p>Bad outcome (note the fact that there's a horizontal scrollbar):</p>
  
  <p><a href="https://i.stack.imgur.com/FGeIG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FGeIG.png" alt="bad resize example"></a></p>
  
  <p>While I keep resizing the window, the table view keep adding and removing the horizontal scrollbar, thus flickering. This is what I want to avoid.</p>
  
  <p>I wonder how the original <code>tile</code> function handles this. How would I enable it so that I don't get the flickering, yet have the scrollbars appear as needed?</p>