Binding the Text Fields to the Table Cell Views

Just like with a data source, when a table view’s Content is bound, each row in the table view maps to an object in that array. Each cell in the row, an instance of NSTableCellView, has its objectValue set to that object. Controls within those cells, such as text fields, will typically display the value of a property on that object. In RaiseMan, the objectValue of each cell will be the Employee object for that row.

Therefore, you need to bind the text fields in RaiseMan’s columns to the cell views’ objectValue. You will follow a similar approach to the one you used when configuring the binding in SpeakLine.

The employee’s name will be displayed in the first column’s cell. To set this ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.