• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Array controller sorting vs ValueTransformers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: NSUserDefaults and objects
  • Next by Date: Re: Embedding image data
  • Previous by thread: How to get NSPopUpButtonCell as an NSTextAttachment sending self instead of nil when it performs it's attached target/action
  • Next by thread: App crashes in Rosetta in "mouseMoved:"
  • Index(es):
    • Date
    • Thread