Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Sorting result of distinctUnionOfObjects of NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting result of distinctUnionOfObjects of NSArrayController

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...


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)

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.