Re: Table sort image question
Re: Table sort image question
- Subject: Re: Table sort image question
- From: Graham Cox <email@hidden>
- Date: Tue, 6 Jan 2009 21:22:23 +1100
On 6 Jan 2009, at 6:20 am, Jon C. Munson II wrote:
Essentially what I’m trying to do is determine the sort of the
column. One
way I've found is to pull out the indicator image. I plan on
comparing that
to a named image for one of the indicator images. If there is a
better way
to do that, I'd love to know as I haven't dredged anything up on
that yet.
Is there a better way? Let me put it this way: could there possibly be
a worse way?
This is nuts.
Look into sort descriptors. Presumably you are trying to determine
which direction the column is sorted in so that you can sort some data
accordingly? (Otherwise, what are you trying to do?). The table view
maintains sort descriptors which not only contain the direction but
the sort key and selector to use for sorting, and these descriptors
can be simply passed to a mutable array to sort the array accordingly.
The table then redisplays the contents. The table's data source can be
informed of a change to the sort descriptors by the user (like when
they click a column header) and the data can be resorted.
--Graham
_______________________________________________
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