Re: Table column index
Re: Table column index
- Subject: Re: Table column index
- From: glenn andreas <email@hidden>
- Date: Mon, 25 Feb 2008 17:12:36 -0600
On Feb 25, 2008, at 4:41 PM, Quincey Morris wrote:
What I was asking about is whether (for example, and assuming a
column is selected)
[[tableView tableColumns] objectAtIndex: [tableView selectedColumn]]
is in fact the NSTableColumn that's selected. It seems likely, but
the documentation does not say, that the order of the NSTableColumns
in [NSTableView tableColumns] is the same as the current visible
order of the columns in the table.
And it actually hints to the contrary, since -tableColumns is document
to include the hidden columns as well (and doesn't say if they are at
the end or in the middle)
However, as long as you only refer to your table columns by their
identifiers, you can ignore it one way or the other. For example, if
you want to know if the column whose identifier is "Name" is the
selected column, you can do something like:
if ([[table isColumnSelected: [table columnWithIdentifier: @"Name"]]) {
// the column "Name" is selected
}
By adapting the practice of using the column identifier, not only do
you get past this problem, you won't have any problem if you allow the
user to re-order columns.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next
generation of fractal art
_______________________________________________
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