About the automatic table column identifier

可紊 提交于 2019-12-11 04:38:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!