Is it possible to sort without a key?
Is it possible to sort without a key?
- Subject: Is it possible to sort without a key?
- From: Fred Baker <email@hidden>
- Date: Tue, 15 Mar 2005 12:40:00 -0800
I have an NSArray that consists only of NSStrings.
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...
Fred
_______________________________________________
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