Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 sql 查询转换为谓词或获取请求,
select a.name from a group by a.name;
这是一个可能的解决方案:
NSFetchRequest* request = [NSFetchRequest fetchRequestWithEntityName:@"a"]; [request setPropertiesToFetch:@[@"name"]]; [request setPropertiesToGroupBy:@[@"name"]]; [request setResultType:NSDictionaryResultType];