Re: Supporting variable-number of table columns, based on source.
Re: Supporting variable-number of table columns, based on source.
- Subject: Re: Supporting variable-number of table columns, based on source.
- From: "Frederick C. Lee" <email@hidden>
- Date: Tue, 29 Mar 2005 11:15:44 -0800
I believe I understand.
Yes, I can query the data source for the column names.
So I can merely create each NSTableColumn accordingly.
I'm a little lost about mapping the new table columns to the source
columns (beyond pre-defined iVars in a data model).
I sense I need to change the paradigm and use a NSArrayController or
something like that.
Ric.
On Mar 29, 2005, at 10:37 AM, Kay Roepke wrote:
On 29. Mar 2005, at 19:38 Uhr, Frederick C. Lee wrote:
Greetings:
I understand the basic method of populating a table, based on a
model with a given (static/constant) number of iVars that are mapped
to their respective columns of a pre-configured table structure.
But what about when you have a data source (a database table beyond
Cocoa) with an unknown number of columns?
Where can I find some documentation/example out there that shows how
to map an unknown/variable number of columns to a NSTableView?
Well, at some point you will know which columns you have, won't you?
You'll have to query your database about the column names and then set
up the columns programmatically.
See the relevant sections of NSTableView, NSTableColumn and
NSTableViewDataSource documentation for more information.
HTH,
Kay
_______________________________________________
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