Reputation: 48440
I need to be able to do the equivalent of the following SQL using Core Data:
SELECT DISTINCT(foo) FROM bar
Is there a way of doing this with NSPredicate? Or any other way for that matter?
Upvotes: 1
Views: 381
Reputation: 8261
I believe all you need to do is add this to your NSFetchRequest
[request setReturnsDistinctResults:YES];
Upvotes: 1