Created
February 2, 2012 16:50
-
-
Save hiddenmemory/1724518 to your computer and use it in GitHub Desktop.
SELECT name FROM SomeObject WHERE type = 'static' GROUP BY name [iOS5 Core Data ARC Remix]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray*)listOfNames { | |
NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
[request setEntity:[NSEntityDescription entityForName:@"SomeObject" inManagedObjectContext:self.managedObjectContext]]; | |
[request setResultType:NSDictionaryResultType]; | |
[request setPropertiesToFetch:[NSArray arrayWithObject:@"name"]]; | |
[request setPropertiesToGroupBy:[NSArray arrayWithObject:@"name"]]; | |
[request setPredicate:[NSPredicate predicateWithFormat:@"type = %@", @"static"]]; | |
return [self.managedObjectContext executeFetchRequest:request error:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment