开发者

How to dynamically populate NSOutlineView's columns?

I have an IBOutlet to an NSOutlineView and I want to remove the existing columns and add the new ones.

I have tried this to add columns

[outlineView setOutlineTableColumn:myNewCol];

and

[outlineView addTableColumn:myNewCol];

with no luck.

To remove I tried this:

NSArray *existingColumns = [outlineView tableColumns];
for (NSTableColumn *col in existingColumns)
    [outlin开发者_如何学PythoneView removeTableColumn:col];

Any help?

Thanks!


setOutlineTableColumn: sets the column that has disclosure buttons in it. It doesn't add columns.

If both of those are simply not doing anything, make sure outlineView (which, I assume, is an IB outlet) is connected in your nib.

If something else happens, please tell us what in your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜