Re: Can CoreData return only unique results of an attribute
Re: Can CoreData return only unique results of an attribute
- Subject: Re: Can CoreData return only unique results of an attribute
- From: Jim Correia <email@hidden>
- Date: Wed, 27 Feb 2008 10:31:01 -0500
On Feb 26, 2008, at 7:34 PM, Adam Gerson wrote:
Thanks for the example. What I am looking for is slightly diferent.
Lets say I have a entity called FavoriteWebsites with the attributes
name and url. The current contents of the object are
Name | URL
---------------------------------------------
Sam | http://www.aol.com
Adam | http://www.digg.com
Jane | http://www.ibm.com
John | http://www.aol.com
I want to filter for only the unique values of url, so the list I want
to get back for a separate table is
http://www.digg.com
http://www.ibm.com
http://www.aol.com
Core Data doesn't have a way for you to fetch a set of items based
where a particular property will be distinct in the result set. You'll
have to post-process the results.
Depending on what it is your are modeling, you can consider whether
normalizing the URL into its own entity is the correct solution.
Jim
_______________________________________________
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