title: OS X: Sorting NSTableView binding to NSArrayController
body: <p>I have NSTableView bind it to NSArrayController. I'm sorting the NSTableView and it works fine but when I click on the row of NSTableView I get different value is like the NSArrayController is not been sorted.</p>
  
  <p>Here is how I'm sorting the NSTableView:</p>
  
  <pre><code>NSSortDescriptor *sd = [NSSortDescriptor sortDescriptorWithKey:@"names" ascending:YES];
  [self.names setSortDescriptors:[NSArray arrayWithObject:sd]];
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/IJfgW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IJfgW.png" alt="enter image description here"></a></p>
  
  <p>For example when I click on Name1 I get the value of the Name2. What I need is to match the values of NSTableView with the NSArrayController. Any of you knows what I'm doing wrong? or how can sort both the NSTableView and the NSArrayController ?</p>
  
  <p>I'll really appreciate your help</p>