View-based table view losing selection highlight

Discussion in 'Mac Programming' started by Starfox, Nov 26, 2012.

  1. Starfox macrumors 6502


    Apr 7, 2011
    I have a view-based NSTableView and when the selection changes I send a reloadData message to it. When it was cell-based the selected rows would maintain their highlight, after I moved it to being view-based the selected rows no longer keep their highlight. Any ideas?
  2. jeanlain macrumors 65816

    Mar 14, 2009
    If you're using bindings, does the array controller have the "preserve selection" attribute checked in IB?
    But I think I'm seeing the same behavior where -reloadData would deselect rows even though "preserve selection" is on. It should be possible to keep a reference to the array's selected objects (via the -selectedObjects key) and select them again.

Share This Page