Array controller sorting vs ValueTransformers
Array controller sorting vs ValueTransformers
- Subject: Array controller sorting vs ValueTransformers
- From: Matt Gough <email@hidden>
- Date: Mon, 13 Mar 2006 16:10:16 +0000
I have a table view with column whose rows display the host portion
of a NSURL
When sorted it might look like this:
developer.apple.com
news.bbc.co.uk
www.zdnet.com
I have been experimenting with using a value transformer to map the
host name into something more meaningful.
Suppose I have the hosts listed above and my value transformer
decides to change news.bbc.co.uk into 'BBC news". I would really want
the column to sort as follows:
BBC news
developer.apple.com
www.zdnet.com
but it ends up as:
developer.apple.com
BBC news
www.zdnet.com
Obviously it is doing this as my sort key for this column is 'host'
and the transformed value does not get used in the sorting process.
Is there no way to get a transformed value involved in the sorting
process?
I guess I could put a category on NSURL to provide the prettified
string and use that as the model key path and sort key.
Matt Gough
Softchaos Limited
_______________________________________________
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