0

Scenario:
I'm passing a NSTableColumn into a function from which I toggle it's hidden flag:

func process(tableColumn:NSTableColumn, purpose:PricingCommercialMenuItems) {
        switch purpose {
        case .RemoveColumn:
            tableColumn.hidden = true
...
}

Column identifiers used with NSTableView autosave feature must conform to NSCoding protocol: (null)
2016-01-06 12:08:27.191 Odyssey[3419:144864] (
    0   CoreFoundation                      0x00007fff90463ae2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff941e5f7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff9046398d +[NSException raise:format:] + 205
    3   AppKit                              0x00007fff9781834d -[NSTableColumn setHidden:] + 287

How do I make the column identifiers conform to NSCoding?

or... is this a bug?

Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
  • You have presumably neglected to set the identifier at all. How/where was the table column created? – Ken Thomases Jan 06 '16 at 21:07
  • I was given a NSTableView with identifiers. I did some research to learn that EVERY NSTableColumn needs a bona fide NSCoding-compliant identifier. So even though the list of existing identifiers looked okay, I reset them with generated strings. That fixed it. – Frederick C. Lee Jan 06 '16 at 21:10

1 Answers1

0

The NSTableView was created earlier with its own NSTableColumn identifiers. I glanced at a few identifiers and they appear to be okay.

Apparently not: I had learned the all identifiers have to be bona fide NSCoding-Compliant. So perhaps some identifiers were erroneous.

Remedy: I generated a new String-type identifier/NSTableColumn (overriding any existing identifier). That did the trick.

Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105