• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retrieving the distinct values of an attribute for a Core Data entity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: "I. Savant" <email@hidden>
  • Date: Fri, 13 Feb 2009 14:08:25 -0500

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/Concepts/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

  • Follow-Ups:
    • RE: Retrieving the distinct values of an attribute for a Core Data entity
      • From: "Jon C. Munson II" <email@hidden>
    • Re: Retrieving the distinct values of an attribute for a Core Data entity
      • From: "I. Savant" <email@hidden>
References: 
 >Retrieving the distinct values of an attribute for a Core Data entity (From: "Jon C. Munson II" <email@hidden>)

  • Prev by Date: Re: Window Max Zoom Size
  • Next by Date: Re: Retrieving the distinct values of an attribute for a Core Data entity
  • Previous by thread: Retrieving the distinct values of an attribute for a Core Data entity
  • Next by thread: Re: Retrieving the distinct values of an attribute for a Core Data entity
  • Index(es):
    • Date
    • Thread