开发者

How to efficiently fetch one column using CoreData

开发者 https://www.devze.com 2023-04-09 23:12 出处:网络
I have a Table with 50,000 records (table has 8 columns). I need to display only 开发者_运维问答1st column on the Table. I need an array which contains all data from Table only from 1st column. How to

I have a Table with 50,000 records (table has 8 columns). I need to display only 开发者_运维问答1st column on the Table. I need an array which contains all data from Table only from 1st column. How to use NSFetchRequest to get all record from 1st column of the Table using Core Data?


You need to use setPropertiesToFetch: method like

[request setPropertiesToFetch :[NSArray arrayWithObject:@"<#Attribute name#>"]];

e.g.,

[fetchRequest setPropertiesToFetch:[NSArray arrayWithObjects:@"ColName", nil]];

Refer link

0

精彩评论

暂无评论...
验证码 换一张
取 消