• 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: Supporting variable-number of table columns, based on source.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Supporting variable-number of table columns, based on source.


  • Subject: Re: Supporting variable-number of table columns, based on source.
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Wed, 30 Mar 2005 13:36:02 +0200

At 9:38 Uhr -0800 29.03.2005, Frederick C. Lee wrote:
Where can I find some documentation/example out there that shows how to map an unknown/variable number of columns to a NSTableView?

It's very easy. Just create it in code. Each column in an NSTableView is represented by an NSTableColumn object. Just create it using alloc/init, add it to your table. If you're using alternating row colors, you may have to fiddle with the data cell a little (I think you need to use an NSTextFieldCell and set it to not draw its background), but that's as complicated as it gets.


A quick read of the headers should get you all the method names you need. Though you may want to use Key-Value-Coding based on the column identifier (which you of course would have to set) to allow yourself to generically access all your columns' data with the same code from your data source.

But there are no hidden pitfalls, I've successfully done it for an SQLite table.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Supporting variable-number of table columns, based on source. (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: Re: Queue of NSStrings
  • Next by Date: Re: Recommended Reading
  • Previous by thread: Re: Supporting variable-number of table columns, based on source.
  • Next by thread: Multiple documents per window
  • Index(es):
    • Date
    • Thread