I have successfully created a cell-based NSTableView purely in code. I would like to make the cells a little more interesting and I have read that I need to create a view-based NSTableView.
I have been tutorials like this.
The rest of my UI is entirely in code. I have been trying to do the same for this tableview without much luck.
Here is how I am defining the TableView — I need to stop registering the Nib and I am not sure how:
let nib = NSNib(nibNamed: "TransactionCellView", bundle: NSBundle.mainBundle())
tableOfTransactions.registerNib(nib!, forIdentifier: "TransactionCellView")
tableOfTransactions.headerView = nil
tableOfTransactions.setDelegate(self)
tableOfTransactions.setDataSource(self)
tableOfTransactions.reloadData()
Here is my stub code for each cell:
func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView?{
var testCell = NSView()
testCell.frame = NSRect(x: 0, y: 0, width: 300, height: 200)
return testCell
}
Any pointers or suggestions on how to achieve this would be much appreciated!