How to fetch distinct values in Core Data?
- by Andy
So in looking through Core Data Snippets, I found the following code:
...
[request setEntity:entity];
[request setResultType:NSDictionaryResultType];
[request setReturnsDistinctValues:YES];
[request setPropertiesToFetch:[NSArray arrayWithObject:@"<#Attribute name#>"]];
// Execute the fetch
NSError *error;
id requestedValue = nil; // WTF?…