I am trying to set up a large number of columns in an NSOutline/TableView and want to set the formatting for the columns programmatically to a custom NSNUMBERFORMAT (or even to a generic nsnumberformat that has presets) I have tried variations of the following:
let nf = NSNumberFormatter()
nf.numberStyle = .PercentStyle
let c = col.dataCell as! NSTextFieldCell
c.formatter = nf
if let tableCellView = analyticResultsOutlineView.makeViewWithIdentifier("Two",owner: self) as? NSTableCellView? {
if let textField = tableCellView?.textField {
textField.cell!.formatter = nf
}
}
I have been successful at binding the formatter and dropping it under the nstextfieldcell but even then, the bound singleton custom formatter appeared to change with different columns.
Any help would be appreciated.