开发者

CoreData: NSSortDescriptor - Á to A, à to A (@selector)

I'm using s selector (localizedCaseInsensitiveCompare:), but i need also to use the Diacritic selector.

Code:

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

How can I use both?

Thanks,

RL


You should use UILocalizedIndexedCollation for doing sorting and categorizing entries into sections. The code for implementing this is in the question NSFetchedResultsController v.s. UILocalizedIndexedCollation

The UILocalizedIndexedCollation was built to be able to on a per-language basis categorize words based on the current language settings. Á and à will be put in section A.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜