title: How can I remove all NSTableColumns from an NSTableView?
body: <p>I am trying to implement a method to clear the NSTableView of all items AND columns. But I get a crash when I try to implement the following:</p>
  
  <pre><code>- (void)clearResultData
  {
      [resultArray removeAllObjects];
      NSArray *tableCols = [resultTableView tableColumns];
      if ([tableCols count] &gt; 0)
      {
          id object;
          NSEnumerator *e = [tableCols objectEnumerator];
          while (object = [e nextObject])
          {
              NSTableColumn *col = (NSTableColumn*)object;
              [resultTableView removeTableColumn:col];
          }
      }
      [resultTableView reloadData];
  }
  </code></pre>