Last active
November 21, 2015 22:28
-
-
Save csexton/f958041b48cc48b95b49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? { | |
let cellview = tableView.makeViewWithIdentifier("accountCell", owner: self) as! AccountTableCellView | |
cellview.nameField!.stringValue = self.objects.objectAtIndex(row) as! String | |
cellview.typeField!.stringValue = self.objects.objectAtIndex(row) as! String | |
return cellview | |
} | |
// ------ | |
func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? { | |
if let cellview = tableView.makeViewWithIdentifier("accountCell", owner: self) as? AccountTableCellView { | |
cellview.nameField!.stringValue = self.objects.objectAtIndex(row) as! String | |
cellview.typeField!.stringValue = self.objects.objectAtIndex(row) as! String | |
return cellview | |
} | |
return nil | |
} | |
// ----- | |
func tableView(tableView: NSTableView, viewForTableColumn tableColumn: NSTableColumn?, row: Int) -> NSView? { | |
let cellview = tableView.makeViewWithIdentifier("accountCell", owner: self) | |
if let cell = cellview as? AccountTableCellView { | |
cell.nameField!.stringValue = self.objects.objectAtIndex(row) as! String | |
cell.typeField!.stringValue = self.objects.objectAtIndex(row) as! String | |
} | |
return cellview | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment