MausD
MausD

Reputation: 125

Swift NSTableView add Column programmatically -> Column-Title

When i add a Column programmatically to a NSTableView

    column = NSTableColumn()
    column.headerCell.setStringValue("Column-Title")  -> Here the Error
    outletTable.addTableColumn(column)

Xcode throws the Error

'($T3) -> $T4' is not identical to 'String!'

Anybody had an idea?

Thanks

Upvotes: 2

Views: 1486

Answers (1)

MausD
MausD

Reputation: 125

The type of Header-Cell is "AnyObject". To set the Colum-Title use:

column.headerCell.setObjectValue("Column-Title") 

Solved!

Upvotes: 3

Related Questions