On Jun 2, 2014, at 7:38 PM, Laurent Daudelin wrote:

> I have what I think is a simple CoreData question.
> 
> Suppose I have an Employee table and a City table, a little bit like the 
> CoreData documentation. Each employee resides in a city.
> 
> Now, multiple employees can reside in the same city. Suppose I fetch a 
> certain number of employees, how do I find how many cities this group of 
> employees reside in? 

-[NSFetchRequest setReturnsDistinctResults:]

I don't know whether any of the KVC aggregation operators work in fetch 
predicates--they are not documented to--but worst case you just get the result 
array count.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to