Working in Swift and AppKit on macOS: I have an NSTableView
which is all working as expected - except the table does not show any column header sort indicator when it initially loads.
My table content is sorting as expected on the initial load, and clicking on column headers to sort works as expected (including showing the column header sort indicator) - it's just the indicator on the initial load isn't working.
Based on NSTableView and displaying sort image in column header question I've tried adding the following to my viewDidLoad
- but it seems to make no difference whatsoever:
let timeStampColumn = backupsTable.tableColumn(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Timestamp"))
backupsTable.setIndicatorImage(NSImage(named: "NSDescendingSortIndicator"), in: timeStampColumn!)
What am I doing wrong?!
Set backupsTable.sortDescriptors
to the initial sort descriptors.