title: NSTableView Layout issue with Highlight and Background Color
body: <p>I am basically trying to recreate the popOver that exists in certain Xcode Settings, like this one in Build Settings:</p>
  
  <p><a href="https://i.stack.imgur.com/W1ixR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W1ixR.png" alt="enter image description here"></a></p>
  
  <p>I have tried both with and without using an <strong>NSArrayController</strong> to control the content but in each of the tests I ran in to different problems I haven't been able to solve.</p>
  
  <h1>Desired Result</h1>
  
  <ul>
  <li>Complete White Background</li>
  <li>Multiple Selection and (Single) Editable Cells</li>
  <li>No Reordering is required</li>
  <li>When I press the + button I want the new cell to be selected and in edit mode</li>
  <li>I want to get notification of when text changes while editing to be able to respond to that.</li>
  </ul>
  
  <h1>1. Using Delegate Methods.</h1>
  
  <p>When I had set up everything up I got this result:</p>
  
  <p><a href="https://i.stack.imgur.com/SXtnk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SXtnk.png" alt="enter image description here"></a></p>
  
  <p>That didn't look good, so I went and selected "Draws Background" for the <strong>NSTableViewCell</strong>, which resulted in this which looks nice when I edit a cell:</p>
  
  <p><a href="https://i.stack.imgur.com/Xcoep.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xcoep.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/uiNjK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uiNjK.png" alt="enter image description here"></a></p>
  
  <p>But when i just Highlight the cell, it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/NbK9A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NbK9A.png" alt="enter image description here"></a></p>
  
  <p>It looks like the highlighting get's placed behind the cell background.</p>
  
  <p>Here I'm stuck and don't know how to fix.</p>
  
  <h1>2. Using NSArrayController</h1>
  
  <p>When I reconfigure and bind this to an <strong>NSArrayController</strong> the highlighting looks great:</p>
  
  <p><a href="https://i.stack.imgur.com/3rDWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3rDWm.png" alt="enter image description here"></a></p>
  
  <p>But when I edit a cell, the entire background changes to grey:</p>
  
  <p><a href="https://i.stack.imgur.com/aI7lv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aI7lv.png" alt="enter image description here"></a></p>
  
  <p>This is also not what I want, but can't figure out what to do about.</p>
  
  <p>--</p>
  
  <h1>Notes</h1>
  
  <p>In Desired Result I listed some things like "When I press the + button I want the new cell to be selected and in edit mode" and "I want to get notification of when text changes while editing to be able to respond to that." To possibly influence the choice of what route to take, as there are more things about thins TableView I haven't figured out.</p>
  
  <p>But this question Is all about how to fix the highlighting and selection so they stay white all the time, and just selecting a cell looks as expected.</p>
  
  <h1>Example Code</h1>
  
  <p>Example code for the Delegates Method version:</p>
  
  <p><a href="https://github.com/erikberglund/StackOverflow/tree/master/TableViewDelegates" rel="nofollow noreferrer">https://github.com/erikberglund/StackOverflow/tree/master/TableViewDelegates</a></p>
  
  <p>Example code for the Bindings version:</p>
  
  <p><a href="https://github.com/erikberglund/StackOverflow/tree/master/TableViewBindings" rel="nofollow noreferrer">https://github.com/erikberglund/StackOverflow/tree/master/TableViewBindings</a></p>