Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stuck with NSSortDescriptor



Hi Micha,

You don't give us the code where you add the sort descriptor to the array controller, but from the looks of things, are you maybe calling [arrayController setSortDescriptors:alphaSortDescriptor] (i.e. setting just the descriptor itself, instead of an array of descriptors)?

The code should look something like [arrayController setSortDescriptors:[NSArray arrayWithObject:alphaSortDescriptor]];.

I only ask because the exception that you are getting looks like something is trying to treat an NSSortDescriptor as if it were an NSArray.

Hope this helps,
	- Greg

On May 2, 2007, at 9:44 AM, Micha Fuhrmann wrote:

Hi there,

I've got an NSArrayController pointing to NSSortDescriptor in a custom class using the Model Key Path in the IN Bindings.


Here's the sort descriptor:

alphaSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"artist" ascending:YES selector:@selector (caseInsensitiveCompare:)];


The same NSArrayController has its Model Key Path's contentArray set as:


@distinctUnionOfObjects.artist

and is working fine without  the descriptor.

However as soon as I link the NSSortDescriptor I get the following error message:

[NSSortDescriptor count]: selector not recognized [self = 0x396fd0]
An uncaught exception was raised
[NSSortDescriptor count]: selector not recognized [self = 0x396fd0]
Uncaught exception: <NSInvalidArgumentException> *** - [NSSortDescriptor count]: selector not recognized [self = 0x396fd0]



Any help greatly appreciated.

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Stuck with NSSortDescriptor (From: Micha Fuhrmann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.