2011-09-01 33 views
1

我正在使用s選擇器(localizedCaseInsensitiveCompare :),但我還需要使用Diacritic選擇器。CoreData:NSSortDescriptor - 到A,à到A(@selector)

代碼:

NSFetchRequest *request = [[NSFetchRequest alloc] init]; 
    request.entity = [NSEntityDescription entityForName:@"CompanyActivity" inManagedObjectContext:context]; 
    request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:descriptionLanguageKey 
                        ascending:YES 
                         selector:@selector(localizedCaseInsensitiveCompare:)]]; 

我怎麼能同時使用?

感謝,

RL

回答

1

您應該使用UILocalizedIndexedCollat​​ion做整理和分類條目段。用於實現此目的的代碼位於問題NSFetchedResultsController v.s. UILocalizedIndexedCollation

UILocalizedIndexedCollat​​ion的構建目的是能夠基於每種語言對基於當前語言設置的單詞進行分類。 Á和à將放在A部分。

+0

因爲我希望á位於A部分之下。 –