• 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
Sorting without a key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting without a key


  • Subject: Sorting without a key
  • From: Micha Fuhrmann <email@hidden>
  • Date: Thu, 10 May 2007 10:59:23 +0200

Hi there!

I'm quoting a message from Fred Baker of 2005 for which no answer was given. I'm stuck with the same issue. Any help would be greatly appreciated.

I was able to bind this array (as contentArray) to an NSArrayController
in IB, and was able to bind the single column in an NSTableView in IB
by specifying Bind to:NSArrayController/Controller
key:arrangedObjects/Model Key Path:<optional>. With this, displaying
data in the table view has been successful. No key-value coding on my
part needed to be implemented.

Unfortunately, I appear to have been knocked up against something hard
when it comes to providing sorting in that table column. Since my
simple array provides me with no key of my own to enter in the Sort Key
field in IB to create the NSSortDescriptor I need, leaving that field
empty makes Sort Selector default to compare: which doesn't seem to
work for strings.

Is there a "default" key one can use when working with such an array? I
can't help thinking it's dumb to have to wrap all those strings in
one-key dictionaries just to get at sorting...


Micha _______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Sorting without a key
      • From: Jonathon Mah <email@hidden>
  • Prev by Date: Re: KVO using threads
  • Next by Date: Re: Sorting without a key
  • Previous by thread: Re: Printing with exotic margins (a basic example)
  • Next by thread: Re: Sorting without a key
  • Index(es):
    • Date
    • Thread