I’ve got a table with checkbox-style cells, and I can’t figure out how to get these buttons to take on the titles that they’re supposed to. Should the data source be an array of strings? An array of dictionaries (string/boolean)? An array of NSButtonCells? None of these seem to work =/
Share
NSButtonCell uses integer values (as NSNumbers) as its data source:
That doesn’t help you with the title of course, you have to set that separately. If you’re using bindings, NSButtonCell defines a
titlebinding you can bind to an array of strings. Otherwise, you can use the NSTableView delegate method- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndexto set the title for each row.