Reputation: 1213
I'm trying to select only some columns from my database, but still yes it returns me all. I'm doing the following:
let fetchRequest = NSFetchRequest(entityName: "Father")
fetchRequest.propertiesToFetch = NSArray(objects: "id", "name")
let sorterByName = NSSortDescriptor(key: "name", ascending: true)
fetchRequest.sortDescriptors = NSArray(object: sorterByName)
i have the following columns:
I need select only id
and name
but returns all columns.
Upvotes: 1
Views: 494
Reputation: 4585
You can find in Apple's documentation for propertiesToFetch
:
This value is only used if resultType is set to NSDictionaryResultType.
Upvotes: 1