Fun with table column identifiers
Fun with table column identifiers
- Subject: Fun with table column identifiers
- From: Jerry LeVan <email@hidden>
- Date: Mon, 28 Oct 2002 14:19:27 -0500
Hi,
I am working on an app that requires that the number of table columns in a
table view be determined at run time.
My first solution was to create the table view with no columns and then add
the columns at the appropriate time.
The problem with this approach is that the column headers lose their Aqua
look.
My next approach was to create a table view with one column in IB. I then
did a deep copy of the one column, this kept the Aqua look of the header.
One nagging irritation, in IB if I enter a 1 (that9s a one with no quotes)
for the column identifier, I do not seem to be able to retrieve the column
from the table view via the call
tmp = [tableView tableColumnWithIdentifier:
[NSNumber numberWithInt:1]];
Or
tmp = [tableView tableColumnWithIdentifier:
@212];
I also tried several variation the the NSNumber construction, but never was
able to get the column!
It is important that I index the columns with NSNumber objects...So the
question is:
If you type an integer in for the column identifier, how can you
retrieve the column?
My (temporary I hope) workaround is to create the single column with
identifier foo, then in my awakeFromNib routine I do:
[ [tableView tableColumnWithIdentifier:@"foo"] setIdentifier:[NSNumber
numberWithInt: 0]];
This seems like an inelegant solution to the problem.
Any suggestions?
--Jerry
_______________________________________________
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.