: Sorting a to-many relationship property

2008-07-17 Thread Keary Suska
Thu, 17 Jul 2008 08:56:23 -0600 > To: "Cocoa-Dev (Apple)" > Conversation: Sorting a to-many relationship property > Subject: Re: Sorting a to-many relationship property > > 7/16/08 6:37 PM, also sprach [EMAIL PROTECTED]: > >> I have a couple entities related b

Re: Sorting a to-many relationship property

2008-07-17 Thread Keary Suska
7/16/08 6:37 PM, also sprach [EMAIL PROTECTED]: > I have a couple entities related by a to-many relationship. Entity Foo > can have 0..N of Entity Bar. I have a relationship defined on Foo > named "bars". In my code, I build a comma-delimited string of Bars by > iterating over the NSArray* returne

Re: Sorting a to-many relationship property

2008-07-16 Thread Rick Mann
On Jul 16, 2008, at 17:51:30, I. Savant wrote: You'll need to sort them yourself after you get them if you're directly getting them via -valueForKeyPath: since there's no way to specify a sort descriptor at that time. NSArray conveniently has a method for exactly that purpose. I realiz

Re: Sorting a to-many relationship property

2008-07-16 Thread I. Savant
But they come back in whatever order Core Data has for them. I'd really like for all requests for Foo.bars to come back sorted by a property of Bar. Is this possible? Or must I either create a new property that sorts them, or just sort them after I get them? You'll need to sort them yours

Sorting a to-many relationship property

2008-07-16 Thread Rick Mann
I have a couple entities related by a to-many relationship. Entity Foo can have 0..N of Entity Bar. I have a relationship defined on Foo named "bars". In my code, I build a comma-delimited string of Bars by iterating over the NSArray* returned by Foo.bars. But they come back in whatever ord