title: How do I get data from an NSTableView?
body: <p>I have an <code>NSTableView</code> with two columns and a data source that fills it with data. That part works.</p>
  
  <p>How do I get data <code>(NSString</code> format) out of the <code>NSTableView</code>? I can get the selected row but <code>NSTableView</code> doesn't seem to have methods for accessing data.</p>
  
  <p>Getting the data from my data source seems to return useless data (type id and <code>NSLog()</code> and <code>NSRunAlertPanel()</code> both claim that the data isn't of the type <code>NSString</code>.</p>
  
  <p>What's the easiest way to get data from an <code>NSTableView</code>?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Turns out the reason getting data from my data source fails has to do with the returning <code>NSString</code> being part of an <code>NSArray</code> in the <code>tableView()</code> method.</p>
  
  <p>My input file contains lines which I split up for the columns in my table view. The <code>NSTableView</code> gets the correct data but when I call the <code>tableView()</code> method myself I run into a <em>EXC_BAD_ACCESS</em> error which I assume has to do with memory management.</p>
  
  <p><strong>Another update:</strong></p>
  
  <p>It wasn't memory management. It was my application's inability to identify the <code>NSTableColumn</code> it wanted. I wrote a second method to access data manually which uses an int for the column rather than a <code>NSTableColumn</code> and that worked.</p>