Column identifiers used with NSTableView autosave feature must conform to NSCoding protocol: (null)

82 Views Asked by At

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?

1

There are 1 best solutions below

0
Frederick C. Lee On

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.