问题
I have create a NSTableView and 2 NSTableColumn in the view. Both of the identifiers of these 2 NSTableColumn set to "Automatic" in Interface Builder.
In the method:
(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
I use
NSLog(@"%@", [tableColumn identifier])
to check the identifier of these 2 NSTableColumn.
I found the identifier of the first column is AutomaticTableColumnIdentifier.0
but the second is (null)
.
Is there any reason that the second column doesn't have a identifier?
I have reduced the attribute "Columns" of NSTableView to 1 and increased it to 2 later, so the first column is included in the NSTableView but the second is not.
回答1:
This is likely the reason:
I have reduced the attribute "Columns" of NSTableView to 1 and increased it to 2 later, so the first column is included in the NSTableView but the second is not.
If it's causing you problems, set the identifiers in the nib.
来源:https://stackoverflow.com/questions/9364680/about-the-automatic-table-column-identifier