Objective-c – NSTableView only displaying “Table View Cell”

cocoanstableviewobjective c

I have a NSTableView with the delegate and datasource pointing to my controller. I have tried implementing the

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex

Method, but no matter what I return, the table always shows "Table View Cell" in the data. Any ideas of what I could be doing wrong? Attached are two pics showing that I have the delegates set properly (it also shows the proper number of rows).

What the table shows
enter image description here

Note that I have also just tried returning @"Hello World" for everything, but I get the same result.

Best Answer

Just change the Content Mode to Cell Based for the table view in IB. IB will display Text Cell as the cell placeholders, which are populated at runtime by whatever you return from tableView:objectValueForTableColumn:row:

Related Topic