所以我有下面的代码,通过“color”属性对核心数据提取进行排序。在排序的核心数据提取结果中排序?
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"color" ascending:YES];
sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
有没有办法取得这种排序的结果,然后按日期(另一个属性)在每个颜色“组”中进行子排序?
基本上这里是什么,我现在得到一个例子...
RED - 11/1/2010
RED - 9/8/2010
RED - 11/9/2011
RED - 10/20/2011
GREEN - 11/1/2010
GREEN - 9/8/2010
GREEN - 11/9/2011
BLUE - 10/20/2011
BLUE - 11/1/2010
BLUE - 9/8/2010
这里就是我想结果怎么看?
RED - 9/8/2010
RED - 11/1/2010
RED - 10/20/2011
RED - 11/9/2011
GREEN - 9/8/2010
GREEN - 11/1/2010
GREEN - 11/9/2011
BLUE - 9/8/2010
BLUE - 11/1/2010
BLUE - 10/20/2011
我敢肯定,这可以被做,但我不知道如何使它发生。
Stephano,如果您觉得它不再有用,您可以删除您的问题(使用问题文本下方的“删除”链接)。 – 2011-04-10 03:32:43