• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting table view rows and columns?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: setting table view rows and columns?
      • From: "Patrick J. Collins" <email@hidden>
References: 
 >setting table view rows and columns? (From: "Patrick J. Collins" <email@hidden>)

  • Prev by Date: setting table view rows and columns?
  • Next by Date: Re: setting table view rows and columns?
  • Previous by thread: setting table view rows and columns?
  • Next by thread: Re: setting table view rows and columns?
  • Index(es):
    • Date
    • Thread