Re: setting table view rows and columns?
Re: setting table view rows and columns?
- Subject: Re: setting table view rows and columns?
- From: Graham Cox <email@hidden>
- Date: Fri, 13 Mar 2015 14:35:29 +1100
> On 13 Mar 2015, at 2:10 pm, Patrick J. Collins <email@hidden> wrote:
>
> am a little confused with the documentation for NSTableViews... I assume this is the method that one uses to set the "headers" of the table?
>
> - (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;
>
> That's what I am looking to do, but I don't get how I specify how many columns there are in the table?
>
> I have everything else in my table setup properly, I am just trying to figure out how to set the header/column names.
>
The method you mention is part of NSTableViewDataSource protocol. It is used to populate the table content, not the headers.
Normally you just set up the column titles in IB. The titles are actually the tableColumn.headerCell.stringValue property, displayed in a NSTableHeaderView. If you are setting these programmatically, you should probably do tat as part of the table controller's setup, not every time the dataSource method is called (which is at least once per row).
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden