Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save michal-majchrzycki/1cce531753f73f248029a79d5d4538a9 to your computer and use it in GitHub Desktop.
Save michal-majchrzycki/1cce531753f73f248029a79d5d4538a9 to your computer and use it in GitHub Desktop.
let entity = NSEntityDescription.entityForName("Fruits", inManagedObjectContext: context)!
fetchRequest.entity = entity
fetchRequest.sortDescriptors = [sortTitle]
ex.expressionResultType = .DecimalAttributeType
fetchRequest.propertiesToFetch = ["colors"]
fetchRequest.propertiesToGroupBy = ["colors"]
fetchRequest.resultType = .DictionaryResultType
let matchingObjects = try! context.executeFetchRequest(fetchRequest) as AnyObject
self.expenseCategory = matchingObjects
return fetchRequest
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment