RE: Creating an ordered list for combo-box content from a Core Data entity attribute
RE: Creating an ordered list for combo-box content from a Core Data entity attribute
- Subject: RE: Creating an ordered list for combo-box content from a Core Data entity attribute
- From: "Jon C. Munson II" <email@hidden>
- Date: Wed, 8 Apr 2009 18:38:17 -0400
- Organization: JTA Enterprises LLC
Namaste!
I answered my own question: @""
This sorts properly.
Now, for a follow-on, is there anything wrong with using that and binding
the content/content values in the combo box to solely "arrangedObjects" ?
Thanks!!!
Peace, Love, and Light,
/s/ Jon C. Munson II
> -----Original Message-----
> From: cocoa-dev-bounces+jmunson=email@hidden [mailto:cocoa-dev-
> bounces+jmunson=email@hidden] On Behalf Of Jon C. Munson II
> Sent: Wednesday, April 08, 2009 6:25 PM
> To: 'I. Savant'
> Cc: 'Cocoa Developers'
> Subject: RE: Creating an ordered list for combo-box content from a Core
> Data entity attribute
>
> Namaste!
>
> Thank you for the replies.
>
> I originally attempted to get this going through an array controller but
> failed, so I figured it couldn't be done that way and went to a routine to
> do it.
>
> However, your previous reply sparked something and I got the array
> controller partially working. It now returns the list, albeit unordered.
> The contentArray (can't use contentSet in this case) is bound to the
> "master" array controller's
> email@hiddengAttribute. This gets me the
> aggregated list of stringAttributes (or so I think anyway).
>
> Now, when I attempt to set the sort descriptor in the array controller, I
> get a not key-value coding compliant error. This is because there is only
> one attribute being returned and it apparently doesn't have a key that I
> know (and yes, I checked to make sure I spelled my keyPath correctly).
> When
> binding the combo-box content/content values, I simply used
> arrangedObjects
> with no keypath and that seems to be correct as the list is loaded and
> displayed.
>
> However, for the sort descriptor, I know that isn't right. So, how does
> one
> refer to "the first column" of the array controller in this case via sort
> descriptor? Better question might be, what is the keyPath if it isn't the
> attribute name?
>
> Thanks!
>
> Peace, Love, and Light,
>
> /s/ Jon C. Munson II
>
>
> > -----Original Message-----
> > From: I. Savant [mailto:email@hidden]
> > Sent: Wednesday, April 08, 2009 5:05 PM
> > To: email@hidden
> > Cc: Cocoa Developers
> > Subject: Re: Creating an ordered list for combo-box content from a Core
> > Data entity attribute
> >
> > >> So, I've created a relevant method to fetch & load an ordered list.
> > ....
> > > What kind of attribute is it? It should be as easy as setting the
> > > desired sort descriptors (see NSSortDescriptor and associated
> > > companion guide(s)) on the array controller that's providing your
> > > list.
> >
> > Sorry, I realize it sounds like you're doing this with a manual
> > fetch in code. In that case, you'll want to set the NSFetchRequests's
> > sort descriptors since an array controller is not doing the fetching.
> >
> > --
> > I.S.
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please 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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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