Popup Menu Button & Sort Descriptors
Popup Menu Button & Sort Descriptors
- Subject: Popup Menu Button & Sort Descriptors
- From: Thaddeus Cooper <email@hidden>
- Date: Mon, 27 Mar 2006 15:18:12 -0800
Hello All --
I have a popup menu button that is bound to an NSManagedObject that
has a displayOrder attribute and another attribute (the real data). I
use the display order to have a consistent display of the values by
binding sortDescriptors of the NSArrayController to a method that
looks like:
- (NSArray *) foobarSortDescriptor {
NSSortDescriptor *sortDescriptor;
NSArray *theArray;
sortDescriptor = [[[NSSortDescriptor alloc]
initWithKey:@"displayOrder" ascending:YES] autorelease];
theArray = [NSArray arrayWithObject:sortDescriptor];
return(theArray);
}
When the button comes up, the preloaded values are in the correct
order each time -- but the "No Value" entry is always at the bottom
of the list. I tried setting the default value in the CoreData model
to be -1 so that it would be the lowest value item in the list -- but
it still shows up at the bottom. Does anyone have any advice how to
get the "No Value" entry to show up at the top?
Thanks very much.
--Thaddeus O. Cooper
(email@hidden)
_______________________________________________
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