RE: Retrieving the distinct values of an attribute for a Core Data entity
RE: Retrieving the distinct values of an attribute for a Core Data entity
- Subject: RE: Retrieving the distinct values of an attribute for a Core Data entity
- From: "Jon C. Munson II" <email@hidden>
- Date: Fri, 13 Feb 2009 14:09:40 -0500
- Organization: JTA Enterprises LLC
Namaste!
Yes, 'twas and is indeed. That, I believe answers my question.
Many thanks!
Peace, Love, and Light,
/s/ Jon C. Munson II
> -----Original Message-----
> From: I. Savant [mailto:email@hidden]
> Sent: Friday, February 13, 2009 2:08 PM
> To: email@hidden
> Cc: Cocoa-Dev List
> Subject: Re: Retrieving the distinct values of an attribute for a Core
> Data entity
>
> On Fri, Feb 13, 2009 at 1:25 PM, Jon C. Munson II <email@hidden> wrote:
>
> > I need to retrieve the distinct values of a given attribute in a Core
> Data
> > entity.
>
> It's important to remember that Core Data is not a database system.
> It shares things in common, but because that is not its focus, there
> are things you may have to do for yourself.
>
> For example, I don't know that this is possible within a fetch
> request (via a predicate), but I do know that you can fetch the
> non-distinct data you want and use an array or set operator (
> [myResults valueForKeyPath:@"@distinctUnionOfSets.foo"] ) to get the
> distinct list of "foo" values. There are other set and array operators
> as well:
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/C
> oncepts/ArrayOperators.html
>
> Is that what you're asking?
>
> --
> 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