Sorting result of distinctUnionOfObjects of NSArrayController
Sorting result of distinctUnionOfObjects of NSArrayController
- Subject: Sorting result of distinctUnionOfObjects of NSArrayController
- From: Micha Fuhrmann <email@hidden>
- Date: Wed, 9 May 2007 13:12:02 +0200
Hi there,
I've got a table column that's binded to a NSArrayController. The
NSArrayController gets it's content from another NSArrayController
using "@distinctUnionOfObjects.artist" as model key path.
So far so good, now I'm trying to sort that column using the
setSortDescriptors instance method than contains the following
NSSortDescriptor:
alphaSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"artist"
ascending:NO selector:@selector(caseInsensitiveCompare:)];
As the setSortDescriptors is applied to the NSArrayController I get
an error message:
[<NSCFString 0x390490> valueForUndefinedKey:]: this class is not key
value coding-compliant for the key artist.
Which is expected since the content of NSArrayController is an Array
with a suit of NSStrings.
How can I still sort my column then? How can I sort the Array of my
NSArrayController? NSSortDescriptor seems to need a key, since there
is none how can I still sort?
I'm sorry, I know it's stupid, just starting...
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