所以我有下面的代碼,通過「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