开发者

Core Data Fetched Results Order

I"m working with a core data model of Employees. Each employee is assigned a building and a department. I am returning everyone in building 1 with the predicate, building == 1 and using the sectionNameKeyPath parameter to break the result set down into groups by department.

Right now I have a sort descriptor ordering the departments alphabetically, but is there a way to ignore sorting them alphabetically and organize th开发者_JAVA技巧em in my own way, like engineers first, security second so on and so forth? I'm still getting used to the terminology and there's probably something I'm overlooking.

Thanks,


Note that the sortDescriptors property of the fetched results controller is an array, so you can set multiple sort descriptors which will be used in the order you specify them (e.g. first by department.name, then by lastName, then by firstName).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜