• 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 a TableView column title via code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting a TableView column title via code?


  • Subject: Re: Setting a TableView column title via code?
  • From: Joseph Heck <email@hidden>
  • Date: Sun, 26 Oct 2003 15:48:00 -0800

On Oct 26, 2003, at 2:00 PM, Chewtoy wrote:
> I'm new to cocoa so bear with me i haven't found a way to set the
> title of a specific column via code?

Basically, you'll want to get the NSTableColumn and then you can use
the instance method headerCell to get the Cell and then setStringValue
on that to set the text. The note on doing this buried in the
documentation is at
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSTableColumn.html#//apple_ref/doc/
uid/20000119/headerCell

Code snippet that probably doesn't work because I'm writing it in Mail

NSTableColumn * tc = [myTableView
tableColumnWithIdentifier:@"myColumnName"];
[[tc headerCell] setStringValue:@"some obnoxiously long title for the
column"];


There's some really nice notes on learning how to mess with TableView
at http://www.cocoadev.com/index.pl?NSTableView and
http://www.cocoadev.com/index.pl?NSTableViewTutorial

-joe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Setting a TableView column title via code? (From: Chewtoy <email@hidden>)

  • Prev by Date: Re: The Problems with NSController
  • Next by Date: Re: keyDown events question
  • Previous by thread: Setting a TableView column title via code?
  • Next by thread: EOF on Mac OS X
  • Index(es):
    • Date
    • Thread